how to get domain name for any webpage javascript code example Example: get domain name javascript window.location.hostname