Use the simple javascript function
<script type="text/javascript">
function querystring(qstr)
{
qstr = window.location.search.substring(1);
q_vars = qstr.split("&");
for (i=0;i<q_vars.length;i++)
{
ft = q_vars[i].split("=");
if (ft[0] == qstr)
{
return ft[1];
}
}
}
</script>
Call using querystring("string")
Sample : www.example.com/index.php?name=aravind&place=venjaramood
var reqQrstr= querystring("name");
document.write(reqQrstr);
Will output : aravind
<script type="text/javascript">
function querystring(qstr)
{
qstr = window.location.search.substring(1);
q_vars = qstr.split("&");
for (i=0;i<q_vars.length;i++)
{
ft = q_vars[i].split("=");
if (ft[0] == qstr)
{
return ft[1];
}
}
}
</script>
Call using querystring("string")
Sample : www.example.com/index.php?name=aravind&place=venjaramood
var reqQrstr= querystring("name");
document.write(reqQrstr);
Will output : aravind
No comments:
Post a Comment