Get URL parameters using jQuery

jQuery code snippet to get the dynamic variables stored in the url as parameters and store them as JavaScript variables ready for use with your scripts. Used differently to Hash Url’s as the world turns to dynamic web apps. Thus things like Decoding URL Strings will be ever popular for years to come.

Copy following code and paste in your JavaScript file

This could be used for example to set the default value of a text input field:


Leave a Reply

Your email address will not be published. Required fields are marked *