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?
- 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?
- 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?
- What does the ++ sign mean in programming code? [duplicate]
- Uncaught ReferenceError: $ is not defined?
- Can scrapy be used to scrape dynamic content from websites that are using AJAX?
- Is there a case insensitive jQuery :contains selector?
- How to add hours to a Date object?
- Are +0 and -0 the same?
- In JavaScript, why is “0” equal to false, but when tested by ‘if’ it is not false by itself?
- Is it true that every function in JavaScript is a closure?
- Facebook how to check if user has liked page and show content?
- Calling method using JavaScript prototype
- How to get the HTML for a DOM element in javascript
- In React, what’s the difference between onChange and onInput?
- How to mock localStorage in JavaScript unit tests?
- VSCode Linter ES6 ES7 Babel linter
- HTML5 canvas drawImage with at an angle
- Override default behaviour for link (‘a’) objects in Javascript
- How to get selected value of a dropdown menu in ReactJS
- Why my $.ajax showing “preflight is invalid redirect error”?
- Scope issues with Angular UI modal
- console.log(array) shows different array contents than iterating the array and displaying the individual elements