Redirect to another page on load
Difference between window.location and location.href
- window.location is an object that holds all the information about the current document location (host, href, port, protocol etc.).
- location.href is shorthand for window.location.href (you call location from global object - window, so this is window.location.href), and this is only a string with the full URL of the current website.
Assigns a new URL to the current window.
Replaces the location of the current window with the new one.
Sets the location of the current window itself.
Sets the location of the topmost window of the current window.