PDA

View Full Version : location.hash - windows or document?


stevio
01-22-2010, 06:25 PM
I am wanting to use the location.hash value in my JavaScript as I am implementing Ajax. However, should I use:
window.location.hash
or
document.location.hash
or just
location.hash
?

Which is most compatible and best to use?

Thanks,
Stephen

A1ien51
01-23-2010, 03:11 AM
window.location is the safer of the two.

In some browsers [I do not think anything modern], document.location was read-only.

Eric