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