<script type="text/javascript">
//得到地址栏传递参数的函数
function QueryString(qs)
{
var s = location.href;
s = s.replace("?","?&").split("&");
var re = "";
for(i=1;i<s.length;i++)
if(s[i].indexOf(qs+"=")==0)
re = s[i].replace(qs+"=","");
return re;
}
window.alert(location.href);
window.alert(QueryString("tid"));
window.alert(QueryString("fpage"));
</script>
//得到地址栏传递参数的函数
function QueryString(qs)
{
var s = location.href;
s = s.replace("?","?&").split("&");
var re = "";
for(i=1;i<s.length;i++)
if(s[i].indexOf(qs+"=")==0)
re = s[i].replace(qs+"=","");
return re;
}
window.alert(location.href);
window.alert(QueryString("tid"));
window.alert(QueryString("fpage"));
</script>
![](https://i-blog.csdnimg.cn/blog_migrate/d86522e41a1c53b89e1ee8cb29d370e3.gif)