The query string format is an internet standard. It is a set of characters input to a Web browser and sent to a query program to retrieve specific information from Server side. Query strings typically contain & , ? and = characters.
A typical URL containing a query string is as follows:
Query String Parameters
The query string format is made up of a series of name-value pairs. Within each pair, the field name and value are separated by an equals sign, '='. The series of pairs is separated by the ampersand, ' & '. In the above case there are two parameters in the querystring- day=sunday and month=january.
In the above function, the function getQueryVal accept two parameters. The field name and the URL.
The above code will return "sunday". If you pass parameter "month" instead of "day" then you will get the result as "january".