I had a JSONP URL, that was pulling data and just switched to a local JSON file and now I am getting errors. I don't understand why it is not working with a local JSON file?
<script type="text/javascript">
$.ajax({
type : 'GET',
dataType : 'json',
url: '/json/topics.json',
success : function(data) {
console.log(data);
var topics = [];
$.each(data.results, function(index, obj){
topics.push({
username: obj.TopicName,
mentions: obj.LastHourCount,
totalcount: obj.TotalCount,
daycount: obj.Last24HoursCount
});
});
$('#leader').tmpl(topics).appendTo('#top3');
}
});
</script>
In the console it is saying AJAX is a anonymous function for some reason? Any suggestions?