use document.location.hostname for hostname