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 157 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
- 25,196
- 9
- 41
- 59