1 2 function getvars(s){ 3 // php preg_match would be as easy as: (/([^&?=])=[^&?=]/g) 4 a = s.match(/[^&?=]*=[^&?=]*/g); 5 r = new Array(); 6 for (i=0; i<a.length; i++) { 7 r[i] = a[i].match(/[^&?=]*/)[0]; 8 } 9 return(r); 10 } 11 /* test */ 12 alert(getvars(window.location.search));
You need to create an account or log in to post comments to this site.