-1

I have this URL https://localhost/test.html?view=1111&project=1000. How would i write java script function to fetch the variable project..?

1 Answers1

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