Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get url without query string

window.location.href.split('?')[0]
Comment

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, '')
Comment

PREVIOUS NEXT
Code Example
Javascript :: create react app node 12 
Javascript :: how to record screen using js 
Javascript :: How do I check if an element is hidden in jQuery 
Javascript :: Code to Unsubscribe all youtube channels. 
Javascript :: onclick prevent default 
Javascript :: get button text javascript 
Javascript :: for char in string javascript 
Javascript :: document ready 
Javascript :: javascript sort array of objects by number 
Javascript :: apply back button to a react component 
Javascript :: javascript date set weeks 
Javascript :: js appendchild wait for callback 
Javascript :: javascript change color for class name 
Javascript :: upload file using ajax 
Javascript :: js get object by id from array 
Javascript :: find item in object js 
Javascript :: js random number between 1 and 10 
Javascript :: Im not getting req.body 
Javascript :: javascript shuffle an array 
Javascript :: javascript check if array is empty 
Javascript :: regex for first three characters 
Javascript :: refresh date and time every second angular 
Javascript :: jquery loop through json 
Javascript :: increment day date javascript 
Javascript :: how to set height dynamically in jquery 
Javascript :: javascript subtract days from date 
Javascript :: javascript check if date is less than today 
Javascript :: prevent reload javascript 
Javascript :: on page fully loaded jquery 
Javascript :: convert base64 string to byte array javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =