I am attempting to load some json into a jQuery tmpl.
The page is here: 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)
});
});
The json is at http://stefairclough.com/jsontest/json.js
I can't seem to figure out why it won't work.
Seems that your XHR request is failing. Try to provide a JSON header with your JSON file. Try renaming your file :
http://stefairclough.com/jsontest/json.json