Разница location.hostname и location.host
Пример:
alert(location.hostname);
alert(location.host);