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
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
No comments