jQuery getJSON request returning empty on a valid request
Posted
by mikemike
on Stack Overflow
See other posts from Stack Overflow
or by mikemike
Published on 2010-03-15T10:10:46Z
Indexed on
2010/03/15
10:19 UTC
Read the original article
Hit count: 526
I'm trying to grab some JSON from Apple's iTunes JSON service. The request is simple: http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsSearch?term=jac&limit=25
If you visit the URL in your browser you will see some well-formed (backed up by jsonlint.com) JSON. When I use the following jQuery to make the request, however, the request finds nothing:
$("#soundtrack").keypress(function(){
$.getJSON("http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsSearch",{'term':$(this).val(), 'limit':'25'}, function(j){
var options = '';
for (var i = 0; i < j.results.length; i++) {
options += '<option value="' + j.results[i].trackId + '">' + j.results[i].artistName + ' - ' + j.results[i].trackName + '</option>';
}
$("#track_id").html(options);
});
});
Firebug sees the request, but only receives an empty response.
Any help would be appreciated here, as I'm at my whits end trying to solve it. You can view the script here: http://rnmtest.co.uk/gd/drives_admin/add_drive (soundtrack input box is at the bottom of the page).
Thanks
© Stack Overflow or respective owner