首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

js a.html向b.html传url有关问题

2013-09-05 
js a.html向b.html传url问题a.htmla hrefb.html?urlhttp://13763682.cominput typebutton value

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 

热点排行