QueryString

Enables access to query string parameters in the URL from Javascript the same way back-end languages can access GET parameters.

Dependencies

QueryString requires the jQuery library. Please download the jQuery library and include it in the <head></head> of your html page.

Basic Query String Example

Use QueryString to get a specific query string variable.

 
<script type="text/javascript" language="javascript">
var qs = QueryString.get('param');
</script>
	

Get Hash Example

Use QueryString to get the URL hash if one is detected.

 
<script type="text/javascript" language="javascript">
var hash = QueryString.getHash();
</script>
	

Advanced Example

Use QueryString to generate a Javascript object of all query strings.

 
<script type="text/javascript" language="javascript">
var obj = QueryString.get_all();
</script>