js location origin code example Example: javascript get origin url console.log(window.location.origin);