Get query string parameter using JavaScript

Following code will help in fetching the value of a query string parameter.

Usage:

If URL is http://server/page.html?id=1

Then usage would be GetQueryStringParameters(“id”) which would return 1