JS——页面带参数跳转,以及页面接收赋值

#index.html
window.location.href = "../home.html?value=" + rec_value;

#home.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)}

 

你可能感兴趣的:(Javasctipt)