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
The correct way of doing this is to do a document.write of the tag based off the current hostname:
Correct:
This method has produced correct results in IE, FF, Chrome, and Safari. It produces a (correct) different result than doing the following:
Incorrect: