jquery - How to retrieve a json from JavaScript -


i trying write html5 mobile application , use jquery json url http://cin.ufpe.br/~rvcam/favours.json tried using

var url='http://cin.ufpe.br/~rvcam/favours.json'; $.getjson(url, function(data, status)     {         console.log(data);         console.log(status);     }); 

but nothing shows on console. don't see doing wrong.

[edit] learned post can't retrieve information server. server in particular (cin.ufpe.br/~rvcam) mine. can use php or other method allow application retrieve data?

the url doesn't return valid json. returns javascript attempts execute function called "foo" , passes object argument. commonly called "jsonp". method of achieving cross domain ajax calls


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -