According to the W3C, they are the same. In reality, for cross browser safety, you should use window.location
rather than document.location
.
More Related Contents:
- How to remove the hash from window.location (URL) with JavaScript without page refresh?
- What’s the difference between window.location and document.location in JavaScript?
- JavaScript: location.href to open in new window/tab?
- JavaScript hard refresh of current page
- What happens to code after a javascript redirect (setting window.location.href)?
- What’s the difference between window.location and document.location?
- Difference between window.location.assign() and window.location.replace()
- window.location versus just location
- window.location.href doesn’t redirect
- Is there a way to have an onload callback after changing window.location.href?
- How to use JSON from instagram API?
- How to update nested state properties in React
- Accessing JPEG EXIF rotation data in JavaScript on the client side
- THREE.js Ray Intersect fails by adding div
- Getting key with the highest value from object
- Cross-browser bookmark/add to favorites JavaScript [duplicate]
- Array.prototype.includes vs. Array.prototype.indexOf
- Disabling the long-running-script message in Internet Explorer
- JSlint error ‘Don’t make functions within a loop.’ leads to question about Javascript itself
- Hit-testing SVG shapes?
- HTML – how can I show tooltip ONLY when ellipsis is activated
- HTML Table with vertical rows
- Strange Unexpected token ILLEGAL in JavaScript [closed]
- Sending message to a specific connected users using webSocket?
- What is the difference between “event loop queue” and “job queue”?
- appendChild in for loop only adds 1 child
- Getting Spotify API access token from frontend JavaScript code
- create javascript date UTC
- Convert long number into abbreviated string in JavaScript, with a special shortness requirement
- JavaScript: replace last occurrence of text in a string