I have this URL https://localhost/test.html?view=1111&project=1000. How would i write java script function to fetch the variable project..?
Asked
Active
Viewed 159 times
1 Answers
0
A cool trick is to split your URL with project=
and take the second element :
const url = "https://localhost/test.html?view=1111&project=1000"
console.log( url.split("project=")[1] )

Jeremy Thille
- 26,047
- 12
- 43
- 63