getting last page URL from history object - cross browser?

Not from the history object, but from document.referrer. If you want to get the last actual page visited, there is no cross-browser way without making a separate case based on support for each property.


You cant get to history in any browser. That would be a serious security violation since that would mean that anyone can snoop around the history of their users.

You might be able to write a Browser Helper Object for IE and other browsers that give you access to that. (Similar to the google toolbar et al). But that will require the users to allow that application to run on their machine.

There are some nasty ways you can get to some history using some "not-so-nice" ways but I would not recommend them. Look up this link.

Tags:

Javascript