get domain name of current page javas cript without www code example Example: get domain name javascript window.location.hostname