Documentation quote: > As of jQuery 1.2, you can load JSON data located on another domain > if you specify a JSONP callback, which can be done like so: > "myurl?callback=?". >jQuery automatically replaces the ? with the correct method name to call, >calling your specified callback.
About JSONP: http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/ ---- Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Jan 15, 2009 at 10:30 AM, James Van Dyke <jame...@gmail.com> wrote: > > It's almost certainly giving you an error about cross-domain XHR > requests. Simply, you can't call URL's that start with "http://" or > else it will throw an error. > > Someone else may know how to get around that, but if you're referring > to your own host, just use a relative path. > > To debug the issue, you may just want to wrap the getJSON() call > inside a try block and catch any errors. Then, you can just use an > alert box to read the message. If the message is too long, use jQuery > to insert it inside an existing visible element. > > Good luck. > > > On Jan 14, 7:08 pm, MorningZ <morni...@gmail.com> wrote: >> "So i want to see what the plaintext is that's returned in the success >> callback" >> >> Use Fiddler (http://www.fiddlertool.com) and it will show you exactly >> what IE is seeing when it makes the AJAX request and gets a result >> back >> >> On Jan 14, 6:51 pm, Rene Veerman <rene7...@gmail.com> wrote: >> >> > I have a getJSON call that works fine in FF, but bugs in IE. >> >> > I get no data. :( >> >> > So i want to see what the plaintext is that's returned in the success >> > callback.. >> >> > Using the new 1.3 jQuery, btw.. >> >> > code: >> >> > var rc = $('select#regions_countries')[0]; >> > var rr = $('select#regions_regions')[0]; >> > var url = >> > 'http://www.myhost.com/members/ajax_fetch_regions_for_countries.php'; >> >> > var countries = []; >> > for (var i=0; i<rc.options.length; i++) { >> > if (rc.options[i].selected) { >> > countries[countries.length] = rc.options[i].text; >> > } >> > }; >> >> > $.getJSON (url, {countries:countries.join('|-|')}, function (data, ts) >> > { >> > var regions = data.regions.split('|-|').sort(); >> >> > var html = ''; >> > for (var i=0; i<regions.length; i++) { >> > html+='<option >> > value="'+regions[i].replace(/\s\(.*\)/,'')+'">'+regions[i]+'</option>'; >> > } >> > rr.innerHTML = html; >> >> > }); >> >>