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