jquery

Get URL parameter using jQuery

With the help of jquery we can easily extract or get URL parameter. This post contains the jquery code which can be used to get URL parameter.

jQuery Script to get URL parameter

This script will help you in extracting the required parameter from URL. The function getUrlParameter() is responsible for extracting parameters from URL and returning the value of required paramater, if found.

Example

For example, you have the following URL
somedomain.com?message=sent

Now you want to find message and its value. Call the function getUrlParamter() and pass the string “message”. The function will extract parameters from current URL will match “message” will each. A value will be returned if “message” parameter is found.