从一个html页面传值到另一个页面

从一个html页面传值到另一个页面,两个html之间的值传递(js location.search用法
转自:https://blog.csdn.net/u012211821/article/details/78919126

Html页面拿html中传过来的值:
<a href=b.html?id=楼主>B页面
b.html中的获取函数:
function getParam(){
C1=window.location.href.split("?")[1]; //得到id=楼主
C2=C1.split("=")[1]; //得到楼主
alert(C1); alert(C2)}

猜你喜欢

转载自blog.csdn.net/weixin_44098197/article/details/89961960