javascript get method of current page code example Example: javascript get domain window.location.hostname