I want to reload the content "onclick" say I have next and prev buttons to
load the respective contents.
JSON is built properly. but when I pass this JSON to the compiled template
, the HTML output is not changed. It still shows the old content.
I moved the HTML into Javascript , placed it in a "var" and this works
perfectly fine. I am not getting what is the issue here. Why is the content
manipulation failing on a HTML page with dust placeholders ?
here is the snippet :
*html : *
<div id= "contentPanel" class="panel panel-info" style="margin-bottom: 0;">
<div class="panel-heading">
<h2 class="panel-title">some heading</h2>
</div>
<nav>
<ul class="list-group bordernone " id="advertisersList">
*{#testContent}*
<li class="list-group-item bordernone"id="id_{contentId}"> <a
id="adv_a_{contentId}" href="#"
onclick="CONTENTS.loadContent({contentId},this);return false;"
>{contentId}: {name}</a> </li>
*{/testContent}*
</ul>
</nav>
</div>
*Javascript : *
var base = jQuery("#contentPanel").html();
var baseCompiled = dust.compile(base, 'base');
dust.loadSource(baseCompiled);
dust.render('base', messages, function(err, out) {
jQuery("#contentPanel").html(out);
console.log(out);
});
JSON :
var messages = { "testContent" : [ { "contentId" : 1, "name" : "content1"}
{........ } ] }
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.