Bug Tracker

Opened 12 years ago

Closed 11 years ago

#10175 closed bug (invalid)

$.getJSON() with url '/' doesn't work in IE

Reported by: jbruler@… Owned by:
Priority: low Milestone: None
Component: ajax Version: 1.6.2
Keywords: Cc: jaubourg
Blocked by: Blocking:


$.getJSON('/', function(){alert('ok');})

This code doesn't work in IE (version 8, 9). It doesn't send any request to server. In other browsers (firefox, opera, chrome) it work properly. I test it with jQuery 1.4.2 and 1.6.2 with same result.

Change History (6)

comment:1 Changed 12 years ago by jbruler@…

Little mistake, code looks like this:

$.getJSON('/', data, function(){alert('ok');})

comment:2 Changed 12 years ago by addyosmani

Component: unfiledajax
Priority: undecidedlow
Status: newopen

Confirmed: http://jsfiddle.net/GEJwe/ (and there's a workaround in there using '') however, I need to discuss with the rest of the group as to whether this is simply expected (but undocumented) behaviour.

Version 0, edited 12 years ago by addyosmani (next)

comment:3 Changed 12 years ago by addyosmani

Further investigation: http://jsfiddle.net/Ga9sB/. So this works fine with cache:false using the complete $.ajax call but not with getJSON. dmethvin and I are investigating.

comment:4 Changed 12 years ago by jaubourg

Now that's weird. You guys found something more or do you want me to hop in and see how we can fix this for 1.7?

comment:5 Changed 12 years ago by addyosmani

Cc: jaubourg added

@jaubourg if you can hop in and see if this is still an issue that would be great.

comment:6 Changed 11 years ago by dmethvin

Resolution: invalid
Status: openclosed

In IE8 and IE9 I can see the browser making the request. It doesn't alert because the response isn't a valid JSON response (at least for me). As the docs say, a bad response often/usually fails silently.

Note: See TracTickets for help on using tickets.