how to get the domain name in javascript code example Example: get domain name javascript window.location.hostname