| Javascript code to get URL and Its different parts through code?
Below is the code to get different part of URL in Javascript
(1)window.location.protocol=This will return "http:" or "https:"
(2)window.location.host=This will return rest part of url like "crackyourinterview.com"
(3)window.location.pathname=this will return the part after .com like "/MainAds-web.aspx"
(4)window.location.search=this will return ?s=search text | | |