Get query string values in JavaScript

Share:
Parameter in URL also called query string parameters or URL variables.
You can get lots of useful data from query string such as id, category, referrals and more.

In JavaScript there is no builtin method to get the parameter value by name but writing some codes we can achieve this.

Example:
Suppose your URL have following parameters : ?id=10&category=mobile
and you want to get the value of parameter category

Using below function you will get the following result : mobile

Function

Hi! I am Sartaj Husain. I am a Professional Software Developer, live in Delhi. I write blogs in my free time. I love to learn and share the knowledge with others because it is no good to try to stop knowledge from going forward. So free posts and tutorials. more..

No comments