Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Javascript getparams (See related posts)

similar to JavaScript GetVars Array and Parse GetVars with JavaScript this fetches all the get variables with corresponding values.
function getparams(s){
  a = s.match(/[^&?=]*=[^&?=]*/g);
  r = new Array();
  for (i=0; i<a.length; i++) {
  	r[i] = new Array(a[i].match(/[^&?=]*/)[0], a[i].match(/=([^&?]*)/)[0].replace('=', ''));
  }
  return(r);
}

Comments on this post

jm3 posts on Oct 20, 2007 at 14:12
nice

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts