Get URL Variables Using JavaScript

This tutorial will explain how to get URL variables using JavaScript. This will help you when you want to do some operation based on the URL variables.

Get URL Variables Using JavaScript

Use the below JavaScript code to print the URL variable. You can use the getQueryVariable() function in your JavaScript to get the variable data from URL. You only need to pass the variable as parameter in getQueryVariable() function.

If your website URL like this

Calling getQueryVariable(“user_data”); // it would return the 128

Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool JavaScript tutorials.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Article Tags: , , , ,