Javascript – get Url
Posted on: May 8, 2012 /
Categories: JavaScript
Get Url or Url parts using Javascript:
window.location.href - get entire url
window.location.protocol - get protocol: "http" / "https"
window.location.host - get hostname, e.g: "www.g31zone.com"
window.location.pathname - get script name, e.g: "example/index.html"