Using the code
It's very easy to use the script. Just include the .js file into the page HTML code and execute it when you want.
The getParams.js, which is saved in the "scripts" folder in the project, includes the function
getURLParameters() which splits the URL string after the first '?' character, and it puts the parameter names and values in separate arrays, which have the same length.
If no parameters are found in the URL string, the appropriate alert comes up.
Finally, I have configured the script in such a way, that if a parameter does not have any value, the alert that shows this parameter, displays "No value" for this parameter.
At the end, the function shows the parameter names and values one by one, in alert message boxes, as it is shown in the picture above.
Points of Interest
I was wondering if it is possible to use URL parameters in client only pages, because it is useful sometimes to handle information and data by this way.
The script can be used in both Internet Explorer and Netscape browsers.