我是JSON和小鬍子的新手。我試圖迭代我使用Mustache創建的數組,並且遇到了一些問題。我的代碼如下所示:如何使用小鬍子迭代JSON數組
var shows=[
{"title":"Strawberry Shortcake","description":"A show about a cake","video":"none","category":"chilren"},
{"title":"Vanilla Ice","description":"A show about a ice","video":"none","category":"adult"}
];
var template="{{#shows}}{{.}}{{/shows}}";
var html=Mustache.render(template,shows);
document.write(html);
請解釋這些問題的* *。你期望什麼? – kapa 2012-02-28 16:10:43
你寫過「interate」而不是「iterate」。我不能自己編輯它,因爲它只是一個字符。 – hippietrail 2012-02-28 16:12:35