[問題] IE7 中javascript問題

看板Web_Design作者 (ericiori)時間18年前 (2008/01/15 16:35), 編輯推噓1(1016)
留言17則, 3人參與, 最新討論串1/1
請問各位大大 我在asp中使用 a.asp(fram頁面)→b.asp 而b.asp的程式中使用 Response.Write "parent.location.href = "http://xxx.asp" 在ie6會轉到xxx.asp頁面,很正常 而在ie7中會變成另外開新的視窗(xxx.asp),請問有無解決方法? 先感謝~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.68.117.124

01/15 17:16, , 1F
怎麼不用response.redirect ??
01/15 17:16, 1F

01/15 17:41, , 2F
因為A那頁是有切fram的,用redirect只是改變fram那一頁
01/15 17:41, 2F

01/15 17:42, , 3F
一塊,我希望的是整個頁面變成在xxx.asp那頁
01/15 17:42, 3F

01/15 17:50, , 4F
parent 改成 top?
01/15 17:50, 4F

01/15 17:57, , 5F
用top是ok的~先感謝starjou大,但是我忘了補充說明a程式
01/15 17:57, 5F

01/15 17:57, , 6F
中是三層的fram的,而b是在第三層的fram中,top會回到最
01/15 17:57, 6F

01/15 17:59, , 7F
上層的fram,但如果我希望是回到第二層的fram中,是否有
01/15 17:59, 7F

01/15 17:59, , 8F
方法呢?
01/15 17:59, 8F

01/15 21:11, , 9F
從 top 去指定第二層的 frame name
01/15 21:11, 9F

01/16 13:25, , 10F
試過囉,但是沒用ie7中沒有效果,我也覺的很奇怪....
01/16 13:25, 10F

01/17 04:00, , 11F
假設你的frame 只有一個 try top.window.frames[0].docume
01/17 04:00, 11F

01/17 04:01, , 12F
nt.location 試試?
01/17 04:01, 12F

01/17 04:01, , 13F
或是給 frame 一個名字然後 top.document.getElementById(
01/17 04:01, 13F

01/17 04:01, , 14F
'frame_name').location 之類的東東
01/17 04:01, 14F

01/17 04:02, , 15F
我是說給一個 id getElementById 後面要接啥再試一下
01/17 04:02, 15F

01/18 18:04, , 16F
top.document.getElementById("XX").location是不行,不
01/18 18:04, 16F

01/18 18:05, , 17F
過src就ok囉~不過還是謝謝starjou大的提示^^
01/18 18:05, 17F
文章代碼(AID): #17Z71H9q (Web_Design)