Reputation: 6052
I'm loading a large number of items on a page through JSON, but it isn't working. This is my first time using JSON and I figured JSON was just a big object so I copied my object that I had before in a variable into a file and names it fun.js.
You can check out the JSON here:
I'm using jQuery to get the JSON:
$.getJSON('fun.js', function(data){
alert(data)
});
Nothing is being alert, in the matter of fact...the alert isn't happening at all. Anyone know why?
Upvotes: 0
Views: 3843
Reputation: 27550
Have you validated that the JSON is the issue? Open up Firebug or Chrome Dev Tools and refresh the page. You may see a message that the file wasn't found or there was a parsing exception or a security error.
Upvotes: 0
Reputation: 3080
For starters, your JSON doesnt validate. Go paste it here and fix your errors: http://jsonformatter.curiousconcept.com/
Secondly, user jQuery.Ajax to which you can pass onError parameter so you'll get a warning that JSON didn't go through.
Upvotes: 5