作者chonhan ()
看板Ajax
标题Re: [ js ] redirect page JavaScript
时间Thu Jul 4 18:04:44 2013
我发现我的问题跟这个发问者一样 但这题好像还是无解
就是 IE 会 redirect 但是会新开一个 tab 而不是在原来的页面跳转
但我希望他的行为是在原本的 parent window 转址 而不是开了一个新的分页
http://forums.asp.net/t/1869378.aspx/1?How+to+redirect+parent+page+from+child+Pop+Up
短网址为
http://ppt.cc/Sagh
不晓得有人有遇到类似的问题吗?
※ 引述《chonhan ()》之铭言:
: 各位版上的先进早安!
: 小弟被这问题困扰了好几天了
: 想问一个关於 parent/child 页面转址的问题
: 问题的描述如下:
: Parent Window A: 使用者一开始使用的视窗 (on Domain X)
: Popout Child Window B: 使用者在 A 视窗点击按钮而产生的子视窗 (on Domain Y)
: 今天在 B 视窗处理完一些事情之後,想要转址原来的 A 视窗 并且将 B 视窗自动关闭
: 程式码如下:
: window.onload = function() {
: setTimeout(function() {
: var redirect_url = document.getElementById('rediurl').value;
: if (window.opener) {
: window.opener.location.href = redirect_url;
: window.close();
: } else {
: window.location.href = redirect_url;
: }
: }, 3000);
: };
: http://jsfiddle.net/uXFJb/1/
: 奇怪的是这段程式在非 IE 以外的浏览器都支援
: 包括 Firefox Chrome Opera Safari 偏偏 IE 就是不支援
: 虽然也很想不支援 IE 但 IE 使用率还是有一定的市场
: 所以想请问一下版上的朋友们,有什麽样的方法可以解决IE的问题吗?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.163.10.190
※ 编辑: chonhan 来自: 118.163.10.190 (07/04 18:06)
1F:→ nfsong:我也有同样的问题 我用jquery dialog iframe连到login 07/09 10:51
2F:→ nfsong:login完想要关掉 然後原本的页面redirect 07/09 10:52
3F:→ nfsong:我还在爬文 07/09 11:41