Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

search query in javascript

 const { search } = useLocation()
const redireactURL = new URLSearchParams(search).get('redirect')
const redirect = redireactURL ? redireactURL : '/'

---------------------
/*
const params = new URLSearchParams(window. location. search)
params. has('test')
params. get('test')
const params = new URLSearchParams(window. location. search) for (const param of params) { console. log(param) }
*/
 
PREVIOUS NEXT
Tagged: #search #query #javascript
ADD COMMENT
Topic
Name
7+1 =