Querystring

by anonymous on May 7th, 2009

No notes

Syntax: JavaScript
Show lines - Hide lines - Show in textbox - Download
var oQS = new Object();
window.location.search.replace( new RegExp( "([^?=&]+)(=([^&]*))?", "g" ),	function( $0, $1, $2, $3 ) { oQS[ $1 ] = $3; } );
 
alert(oQS['id']);
1 Comment
  1. What about URL-decoding of the names and values?

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS