cowboy / jquery-hashchange

This jQuery plugin enables very basic bookmarkable #hash history via a cross-browser HTML5 window.onhashchange event.
http://benalman.com/projects/jquery-hashchange-plugin/
GNU General Public License v2.0
1.21k stars 258 forks source link

hashchange forward navigation failure with JSONP #4

Closed richow closed 14 years ago

richow commented 14 years ago

Overview

In Internet Explorer 6, hashchange forward navigation doesn’t work when using the JQuery JSONP plug-in, http://code.google.com/p/jquery-jsonp/ .

Reproduction steps

1) Navigate to http://webmeter.com.au/problem/ 2) Ensure “Do AJAX” is checked 3) Click “1”. a. The browser will send an AJAX query. Once complete the status message should say “Success for #1”. 4) Click “2”. a. The browser will send an AJAX query. Once complete the status message should say “Success for #2”. 5) Click the browser BACK button a. The browser will send an AJAX query. Once complete the status message should say “Success for #1”. b. In IE6, the forward button will be disabled. This is wrong, it should be enabled and allow forward navigation to “2”.

Do the same test with FF 3.5+ or Safari. At step 5.b the forward button works correctly.

Do the same test again with IE6, but this time at step 2 ensure “Do AJAX” is not checked. At step 5.b the forward button works correctly.

Notes

I realize the reproduction steps are not using cross domain JSON and so don’t need the plug-in. However, I found this problem when actually needing cross domain JSON.

cowboy commented 14 years ago

In IE6/7, when you want to enable the back button for hash history, you use a hidden Iframe. When the hash changes, the Iframe location is changed, and every time the Iframe location changes, a new history entry is added. Unfortunately, any other Iframe on the page will affect the history.. and, you guessed it, the JSONP jQuery plugin also uses a hidden Iframe.

I'm not aware of any workaround for this particular conflict, but seeing as you need a hidden Iframe to enable hash history in IE6/7, can you look into another JSONP solution?

cowboy commented 14 years ago

I talked with Julian Aubourg just now about this, and as a result, he fixed jQuery JSONP issue 15 which seems related, and could very well fix your issue as well. Can you try out his new 1.1.4 release and see if the issue is resolved?

richow commented 14 years ago

Good news, the 1.1.4 release of JSONP fixes the problem! Thanks for taking the time to help with this issue :-)