js how-to-get-the-domain-from-a-url code example Example: javascript get domain window.location.hostname