【发布时间】:2015-09-08 04:49:45
【问题描述】:
我正在尝试将一些 json 加载到 jQuery 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
我似乎无法弄清楚为什么它不起作用。
【问题讨论】:
-
请出示相关代码sn-ps
标签: jquery json jquery-templates