window object in javascript get path code example Example: javascript get domain window.location.hostname