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