日期:2014-05-16  浏览次数:20337 次

js a.html向b.html传url问题
a.html
<a href="b.html?url=http://13763682.com"><input type="button" value="马上观看"></a>
<a href="b.html?url=http://68648846.com"><input type="button" value="体验一下"></a>
<a href="b.html?url=http://fedgdf.com"><input type="button" value="立即观看"></a>


b.html
<script type="text/javascript">
接收a.html传的url
window.location.href='传的url页面';
</script>
接收哪个url打开相应url页面,请各位帮忙看看

------解决方案--------------------
  var m=location.search.match(/url=([^=]+)/);
 if(m) location.href=m[1];
------解决方案--------------------
function init(){
var u=window.location.href;
var reg=/url=(.*)/;
u=u.match(reg)[1];
window.location.href=u;
}
window.onload=init;
这样试试
------解决方案--------------------
放在 b.html 中

比如  b.html?url=http://13763682.com
b.html  -->跳转到 http://13763682.com