Monday, May 11, 2009

getting Query-String Values From Javascript

Getting Query-String Values From Javascript
script type="text/javascript">
function GetQueryStrValFor(key)
{
var returnval="";
var query = window.location.search.substring(1);
var parms = query.split('&');
for(var i=0 to parms.length)

{ var pos = parms[i].indexOf('=');
if (pos > 0)
{
if(key==parms[i].substring(0,pos))
{
returnval= parms[i].substring(pos+1);
}
}
}
return returnval;
}

script>

Share This!


No comments:

Powered By Blogger · Designed By Seo Blogger Templates