Morgan Cheng Morgan Cheng - 2 years ago 117
Javascript Question

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

Should both of them reference to same object?

Answer Source

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


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download