Morgan Cheng Morgan Cheng - 1 year ago 87
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