javascript - How to read a remote JSON file with jQuery.getJSON()? -


i'm new javascript , read remote json file getjson(). reason function returns syntax error unexpected token ) can't figure out wrong.

this do, am'i missing ?

var url = "http://mysafeinfo.com/api/data?list=englishmonarchs&format=json";  $.getjson(url, function (json) {      console.log(json);     alert(json);  )}; 

link jsfiddle

you have javascript error

var url = "http://mysafeinfo.com/api/data?list=englishmonarchs&format=json";  $.getjson(url, function (json) {      console.log(json);     alert(json);  }); // here swapped bracets 

Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

javascript - Angular2 intelliJ config error.. Cannot find module '@angular/core' -