Incorrect hash value is returned to callback function in safari 3.1 under certain conditions
April 2, 2008 - 7:55pm — kolais
to:
| Project: | History |
| Version: | 1.0.0-beta-1 |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Lafriks |
| Status: | active |
Jump to:
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):
#2
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