Example 1 — Example
Typical usage.
JavaScript
console.log(typeof location);
console.log("location.pathname / location.search / location.hash");How It Works
- Parts. pathname, search, hash.
- Navigate. Assign location.href.
location represents the current page URL—read href, pathname, search, or assign to navigate.
console.log(typeof location);
console.log("location.pathname / location.search / location.hash");Typical usage.
console.log(typeof location);
console.log("location.pathname / location.search / location.hash");Check support.
console.log("Location — verify browser/Node support");CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
6 people found this page helpful