Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript: get the url without query string

let path = window.location.href.split('?')[0]
console.log({path})
// {
//  "path": "https://stacksnippets.net/js"
// }

//or

location.href.replace(location.search, '')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #url #query #string
ADD COMMENT
Topic
Name
1+3 =