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