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 in JavaScript?
- 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?
- CasperJS/PhantomJS doesn’t load https page
- Changing iframe src with Javascript
- How to change the Content of a with JavaScript
- When does JS interpret {} as an empty block instead of an empty object?
- The definitive best way to preload images using JavaScript/jQuery?
- How can I implement prepend and append with regular JavaScript?
- jquery smooth scroll to an anchor?
- Javascript event e.which?
- Javascript group objects by property [closed]
- What is the current state of the art in HTML canvas JavaScript libraries and frameworks? [closed]
- Support for ES6 in Internet Explorer 11
- Error: [ng:areq] from angular controller
- How to properly set environment variables in Next.js app deployed to Vercel?
- JavaScript Objects as Hashes? Is the complexity greater than O(1)?
- Google Chrome Extensions: How to include jQuery in programmatically injected content script?
- Get the clicked object that triggered jquery blur() event [duplicate]
- How do I retrieve if the popstate event comes from back or forward actions with the HTML5 pushstate?
- React-Redux: Should all component states be kept in Redux Store
- Img src path with header params to pass
- Assign only if condition is true in ternary operator in JavaScript