I need to make a synchronous request to the last.fm API, but when I use GET and json together, the request becomes asynchronous.
my code:
$.ajax({
async: false,
dataType: "json",
url: "http://ws.audioscrobbler.com/2.0/?method=artist.getimages&artist="+artist+"&api_key="+apiKey+"&format=json&callback=?",
success: function(html){
imgURL = html.images.image[1].sizes.size[0]["#text"];
}
});
If I remove dataType: "json" or use POST, it's synchronous again, but I'm dependant on using both json and GET.
Any ideas?