get current path of website window.location javascript code example Example: javascript get domain window.location.hostname