[Solved] Cannot access json with getJson function


Try this:

$(document).ready(function (){
     $.getJSON('myurl.com/myFile.json',function(result){
          alert(result);
     });
});
  • It should be $(document).ready not $(document).read
  • Remove the extra a after the alert.
  • Remove the extra bracket after the url 'myurl.com/myFile.json') <– This one
  • Please have a look at the jQuery API before starting something new.

2

solved Cannot access json with getJson function