html页面之间传值问题

1.如再A页面(A.html)通过window.open(B.html?code=11)或者通过其他方式跳转到其它html页面时:

  可通过以下方式进行传递参数。

//B.html页面
function
getParameterString(paraName){ var reg = new RegExp("(^|&)"+ paraName+"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return unescape(r[2]); return null; } var code = getParameterString("code");

猜你喜欢

转载自www.cnblogs.com/damoblog/p/9215234.html