📝 Edit page
➕ Add page
Window API
Using Window object in the browser
Related
- Navigation cheatsheet
Resources
- Window in the Mozilla docs.
- Window Object on W3 Schools.
- Window location on W3 Schools
Location
window.location
This object can be used to get the current page URL or load page.
window.location.href
- get or set the current page URL.window.location.protocol
- get the web protocol used -http:
orhttps:
.window.location.hostname
- get domain name.window.location.pathname
- get the path and filename of the current page.window.location.port
- get the port number.window.location.assign()
- load a new document.