我正在使用把手在html中显示一组javascript数组。
javascript数组看起来像这样
[{pid:"1mn0wZj6yN", id:"yUjCaVzZ3CcCdOj"},{pid:"uEG9LXUaZi", id:"0eamlmJAFd2Ltwd"}]
创建一个jquery get请求来获取此数组
$.get( "file.php", function( respo ) {
var temmple = Handlebars.compile($('#template').html());
$('#container').append(temmple(respo));
});
这是句柄栏模板
<script id="template" type="text/x-handlebars-template">
{{#each respo}}
<p>{{id}}</p>
{{/each}}
</script>
输出显示在一个名为container的id的div中,但输出没有显示,也没有给出任何错误。我怎样才能解决这个问题?感谢
答案 0 :(得分:0)