84669 人學習
152542 人學習
20005 人學習
5487 人學習
7821 人學習
359900 人學習
3350 人學習
180660 人學習
48569 人學習
18603 人學習
40936 人學習
1549 人學習
1183 人學習
32909 人學習
是否可以更改彈出視窗的 url。
假設我打開一個彈出視窗:
function pop1(){ window.open('http://google.com','wind1'); }
能否將彈出視窗「wind1」的 URL 改為「http://msn.com」。帶有 location.href 或任何其他解決方案的東西。
對我來說,當我只更改 url 的末尾(參數部分)時,我使用了一個小技巧: 在使用新的相似 url 之前加載不同的 url。 我選擇使用“about:blank”,但可以使用任何網站網址。
self.location = "about:blank"; self.location = desired_url; //this code works fine both in Mozilla Firefox as in Chrome
請注意,location = site;與 location.href = site. 相同 我僅使用 location.href 來讀取當前 url。
雷雷
對我來說,當我只更改 url 的末尾(參數部分)時,我使用了一個小技巧: 在使用新的相似 url 之前加載不同的 url。 我選擇使用“about:blank”,但可以使用任何網站網址。
請注意,location = site;與 location.href = site.
相同 我僅使用 location.href 來讀取當前 url。
雷雷