質問

I cannot seem to get the syntax right for parameters to partials. The following keeps getting a syntax error: Uncaught SyntaxError: Expected buffer, comment, partial, reference, section or special but "{" found dust.js line 60.

<html>
<head>
<script type='text/javascript' src='/static/js/jquery.js'></script>
<script type='text/javascript' src='/static/js/dust.js'></script>
<body>
<p>TEST</p>
<p class='area1'>content_stuff</p>
<script>
$(document).ready(function() {
  dust.loadSource(dust.compile("THE PARTIAL IS: {>inner foo='bar' /} AND THATS ALL", "outer"));
  dust.loadSource(dust.compile("INNERPART", "inner"));
  dust.render("outer", {}, function(err, out) {
    console.log(out);
    $(".area1").html(out);
  });
});
</script>
</body>
</html>
役に立ちましたか?

解決

Stick with the latest linkedin release. I think you may need double quotes around bar param value though.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top