Morgan Cheng Morgan Cheng - 11 months ago 29
Javascript Question

What's the difference between window.location and document.location in JavaScript?

Should both of them reference to same object?


According to the W3C, they are the same. In reality, for cross browser safety, you should use window.location rather than document.location.