Re: [ js ] redirect page JavaScript
我發現我的問題跟這個發問者一樣 但這題好像還是無解
就是 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)
→
07/09 10:51, , 1F
07/09 10:51, 1F
→
07/09 10:52, , 2F
07/09 10:52, 2F
→
07/09 11:41, , 3F
07/09 11:41, 3F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章