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