javascript current url domain code example Example: get domain name javascript window.location.hostname