Plugins

User login
Can't find a Plugin?

Can't find a Plugin you are looking for? Check out the jQuery Wiki page.

Are you a plugin developer? Please move your plugin over to this site.

Website Bug or Feature Request?

Found a bug on the new jQuery Plugin website? Have a feature request?

Submit it to the jQuery Plugin website issue queue to ensure it is noticed!

Incorrect hash value is returned to callback function in safari 3.1 under certain conditions


Project:History
Version:1.0.0-beta-1
Component:Code
Category:bug report
Priority:minor
Assigned:Lafriks
Status:active
Description

If user reloads page and then goes back then callback function will be passing the same hash value regardless of the history. I made a modification in the script (lines 94, 95) from:

// back button has been pushed to beginning and URL already pointed to hash (e.g. a bookmark)
// document.URL doesn't change in Safari
if (document.URL.indexOf('#') >= 0) {
$.history._callback(document.URL.split('#')[1]);

to:
// back button has been pushed to beginning and URL already pointed to hash (e.g. a bookmark)
// document.URL doesn't change in Safari
if (location.hash.indexOf('#') >= 0) {
$.history._callback(location.hash.split('#')[1]);

This worked on Safari 3.1 but I'm unable to test it on previous versions.
Thanks,
Nikolay.

Comments

#1

Just to clarify the case here is some steps to reproduce (using the demo provided):

  1. Open the demo at http://nix.lv/history/demo.html
  2. Click "load 1" then "load 2"
  3. Reload the page in Safari (by clicking "Reload" button)
  4. Click "Back" button in Safari
  5. Text still shows "Loaded html: 2" while address string shows "http://nix.lv/history/demo.html#1" - BUG
  6. Click "Back" agian. Text still shows "Loaded html: 2" - BUG

#2

Assigned to:Anonymous» Lafriks

Fixed in demo. On my home Linux box in Firefox and Konqueror seems to be working fine. I'll test it tomorrow on IE 6/7 and if it's ok I'll release beta2