get the domain of the site javascript code example Example: get domain name javascript window.location.hostname