I am trying to execute an HTTP Get request using jQuery, but I am getting an empty string as an answer, so I assume that I am doing something wrong. As a guide, I used the documentation from http://api.jquery.com/jQuery.get/ .
My code is as follows
$.get("http://www.last.fm/api/auth/?api_key=xxxkeyxxx", function(data){ window.console.log(data); });
Edit: now my code is as follows
$.getJSON("http://www.last.fm/api/auth/?api_key=c99ddddddd69ace&format=json&callback=?", function(data){ window.console.log(data); });
But I get a syntax error [Aborting this error] \ n
And is it at http://www.last.fm/api/auth/?api_key=c99ddddddd69ace&format=json&callback= ?
Last edit: it seems like this is because last.fm responds with html not JSON, any ideas would be appreciated
Crothers
source share