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
host just includes the port number if there is one specified. If there is no port number specifically in the URL, then it returns the same as hostname. You pick whether you care to match the port number or not. See https://developer.mozilla.org/en/window.location for more info.
I would assume you want hostname to just get the site name.