find the url in javascript code example
Example 1: javascript get url path
window.location.pathname
Example 2: javascript get base url
console.log(window.location.origin);
window.location.pathname
console.log(window.location.origin);