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 :: sum javascript 
Javascript :: remove time from date javascript 
Javascript :: selecionar valselect2 js 
Javascript :: load a page with ajax 
Javascript :: fillstyle 
Javascript :: compare dates in js 
Javascript :: eslint ignore file rule 
Javascript :: number pyramid javascript 
Javascript :: javascript regex extract url from string 
Javascript :: iterate over map key value javascript 
Javascript :: iffi in js 
Javascript :: javascript check if elements of one array are in another 
Javascript :: javascript falsy values 
Javascript :: javascript paragraph count 
Javascript :: how to convert a JavaScript iterator to array 
Javascript :: javascript clone array of object 
Javascript :: add property to string js 
Javascript :: how to add button in canvas html5 
Javascript :: how to get timestamp in javascript of a date object 
Javascript :: Sort to reverse from an array in javascript 
Javascript :: js close window 
Javascript :: autocomplete react vscode 
Javascript :: JAVASCRIPT ARRRAY LOOP BACKWARDS 
Javascript :: js toggle boolean 
Javascript :: jquery unbind event 
Javascript :: react-select dropdown open inside modal 
Javascript :: javascript hide address bar mobile 
Javascript :: javascript range 
Javascript :: mongoose schema 
Javascript :: material ui textfield error 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =