Monday, February 19, 2018

Using the GET parameter of a URL in JavaScript




If I am on a page such as




http://somesite.com/somepage.php?param1=asdf



In the JavaScript of that page, I would like to set a variable to the value of the parameter in the GET part of the URL.



So in JavaScript:







What would "..." be?


Answer



Here's some sample code for that.






No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...