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