我試圖加載一些json到jQuery tmpl中。jQuery getJSON數據不加載到tmpl
的頁面是在這裏:http://stefairclough.com/jsontest/
$(document).ready(function() {
$.getJSON("http://stefairclough.com/jsontest/json.json",
function(data){
$("#news_articles").empty();
$("#news_template").tmpl(data).appendTo("#news_articles");
})
.error(function(xhr) {
console.log(xhr)
});
});
的JSON是在http://stefairclough.com/jsontest/json.js
我似乎無法弄清楚,爲什麼它不會工作。
請出示相關的代碼片段 – Moak