I want to set a page\'s base href attribute in Javascript based off of the current hostname. I have generated HTML pages that can be viewed on different hostnames, which mea
As location.hostname does not return the application context root! You could also log the document.location on the console console.log to see all available metadata on document.location.