Posted By

abwaters on 06/07/09


Tagged

querystring


Versions (?)

Query String Parsing in Javascript


 / Published in: JavaScript
 

  1. <script type="text/javascript">
  2. var params = new Object();
  3. window.location.search.replace(
  4. new RegExp( "([^?=&]+)(=([^&]*))?", "g" ),
  5. function( $0, $1, $2, $3 ){
  6. params[ $1 ] = $3;
  7. }
  8. );
  9. </script>

Report this snippet  

You need to login to post a comment.