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

yamin_Crais 2013-08-07 05:22:39
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页面,请各位帮忙看看
...全文
199 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yamin_Crais 2013-08-08
  • 打赏
  • 举报
回复
似梦飞花 你好 window.onload=init;这句是什么意思,在执行跳转方法之前判断页面加载完应该怎么加
fzfei2 2013-08-07
  • 打赏
  • 举报
回复
放在 b.html 中 比如 b.html?url=http://13763682.com b.html -->跳转到 http://13763682.com
似梦飞花 2013-08-07
  • 打赏
  • 举报
回复
function init(){ var u=window.location.href; var reg=/url=(.*)/; u=u.match(reg)[1]; window.location.href=u; } window.onload=init; 这样试试
yamin_Crais 2013-08-07
  • 打赏
  • 举报
回复
这是接收a页面值的吗
fzfei2 2013-08-07
  • 打赏
  • 举报
回复
var m=location.search.match(/url=([^=]+)/); if(m) location.href=m[1];

87,991

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧