1// https://example.com:81/path?argument=value#hash
2
3location.href // https://example.com:81/path?argument=value#hash
4location.protocol // https
5location.hostname // example.com
6location.port // 81
7location.host // example.com:81
8location.pathname // /path
9location.search // ?argument=value (see URLSearchParams to parse)
10location.hash // #hash
11location.origin // https://example.com"
12
1//its actually
2window.location.href = "/App/Home"
3//or
4window.location.href = "https://www.google.com/"
1// Prints complete URL
2window.location.href
3
4// Prints protocol like http: or https:
5window.location.protocol
6
7// Prints hostname with port like localhost or localhost:3000
8window.location.host
9
10// Prints hostname like localhost or www.example.com
11window.location.hostname
12
13// Prints port number like 3000
14window.location.port
15
16// Prints pathname like /products/search.php
17window.location.pathname
18
19// Prints query string like ?q=ipad
20window.location.search
21
22// Prints fragment identifier like #featured
23window.location.hash
1// Let's an <a id="myAnchor" href="https://developer.mozilla.org/en-US/docs/Location.pathname"> element be in the document
2var anchor = document.getElementById("myAnchor");
3var result = anchor.pathname; // Returns:'/en-US/docs/Location.pathname'
4