views:

54

answers:

4

The jQuery History Plugin (http://www.mikage.to/jquery/jquery_history.html) is said to work with Chrome:

http://github.com/tkyk/jquery-history-plugin

Supported Browsers IE6, IE7, IE8, Firefox3, Safari4, Safari5, Chrome4, and Chrome5

but then when i go to the top link mentioned above, if I click on load 1, load 2, and then load 3, the back button will change the URL's hash portion to #2, but the "Loaded html:" section still shows "3"… anybody know why?

+1  A: 

The version used by that demo page is not the same as the github version.

Pointy
please see comment under Nick's answer...
動靜能量
more info added
動靜能量
+2  A: 

Go here for a current sample page: http://www.serpere.info/jquery-history-plugin/samples/

It works in Chrome ;) As Pointy, well, points out, the code on that page isn't current, there are several changes/fixes in GitHub since then. You can get the latest source here.

Note that the API changed (for the better I think) since that old page, for example:

Nick Craver
it works quite well except in both Firefox and Chrome, I do see that http://www.serpere.info/jquery-history-plugin/samples/ajax/, clicking on the "1", "2", "3" will show that it fetches the page twice in Firebug or in Chrome's Developer's tool "Resources"
動靜能量
@Jian Lin that page (http://www.serpere.info/jquery-history-plugin/samples/ajax/) works fine for me in Firefox and in Chrome. I don't know what you mean when you say that it, "fetches the page twice". Which page is fetched twice?
Pointy
the page 1.html is fetched twice... or 2.html... now i placed a new question on http://stackoverflow.com/questions/3187130/jquerys-history-and-bookmark-plugin-may-have-a-bug
動靜能量
@Jian - I see what you mean, I responded to your other question on how to fix this. It's loading it twice because of how it's called...if you click the links very fast, you'll see that it won't always load them twice, only if you click more than 100ms apart.
Nick Craver
A: 

Perhaps try this jQuery History plugin: http://www.balupton.com/sandbox/jquery-history/demo/ It provides cross browser support, binding to hashes, overloading hashes, all the rest.

There is also a Ajax extension for it, allowing it to easily upgrade your webpage into a proper Ajax application: http://www.balupton.com/sandbox/jquery-ajaxy/demo/

This is the solution chosen by such sites as http://wbhomes.com.au/ and http://gatesonline.com.au/stage/public/

Overall it is well documented, supported and feature rich. It's also won a bounty question here http://stackoverflow.com/questions/3205900/how-to-show-ajax-requests-in-url/3276206#3276206

balupton