Get URL parameters using Javascript

Sell Online With Shopify
Trusted by millions of businesses worldwide
For a limited time, sign up for a free trial and enjoy 3 months of Shopify for $1/month on select plans — offer ends Aug 25.

With PHP, We easily get the URL by $_GET method. With JavaScript is not so easy but you still can do that with function below:

Now you can using this function get URL parameter.

Example you want get parameter from “name” parameter in URL: http://domain.com/index.php?name=Kiet. And this is code:

Good luck!

You may also like...

Leave a Reply

Your email address will not be published.