On the page I'm trying 3 different methods to set the hash
setting: location.hash = 'hash'
setting: location.href = 'anchors.html#hash'
setting: hash through regular link
JS will read the hash once it's been set, but hitting back doesn't seem to be updating the location object.
Any thoughts on how to get it to read the hash after hitting back?
The "Back" button contains an array of the window.location.href not of the document
You need to give the full URL to window.location.href for the "back" button to work
Was this your intention?
I'm not trying to read the history array, I'm trying to read the current document.location. When you hit the back button the url location doesn't update.
pyro, there is a link in my first post refering to the problem. I have an interval running which displays the location.href and location.hash of the current page, when you click one of the buttons or links, the text fields update with the new href and hash information, but when hitting the back button, the hash and href don't update, interestingly enough, the link you gave me does update when hitting the back button.
looking at the link you posted further, it appears they are actually sending the browser to a new page, rather than sending the browser to an anchor within that page.
I need a method for finding out which anchor they are at after hitting the back button, without sending the current document to a new page everytime.
Fang, I'm not sure what you mean. I'm not trying to go to a bookmark, I just need to know what anchor the user is currently located at.
document.location.hash will give you the anchor.
The problem with IE appears to be the reference to "top".
Change "top" to "tops" and the problem disappears.
Bookmarks