Which one of these is the most effective vs checking if the user agent is accessing via the correct domain.
We would like to show a small js based \'top bar\' style
MDN: https://developer.mozilla.org/en/DOM/window.location
It seems that you will get the same result for both, but hostname contains clear host name without brackets or port number.
hostname