用js可以这样实现
test1.htm
<a href=test2.htm?str=hello>test2</a>
test2.htm
<script>
var url=location.href;
var str=url.slice(url.indexOf("=")+1);
alert(str)
</script>
如果是用asp,jsp等,那就直接从query字段获取就行了
test1.htm
<a href=test2.htm?str=hello>test2</a>
test2.htm
<script>
var url=location.href;
var str=url.slice(url.indexOf("=")+1);
alert(str)
</script>
如果是用asp,jsp等,那就直接从query字段获取就行了
<script>
document.location.href=test2.html#aabbcc
</script>test2.html
<script>
abcd=document.location.hash;
alert(abcd);
</script>这样就能把"aabbcc"赋值到abcd,然后处理变量abcd就能获得数据