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>
No comments:
Post a Comment