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