更改已打开的弹出窗口的 url

2022-01-20 00:00:00 popup javascript

是否可以更改弹窗的url.

Is it possible to change the url of the popup.

假设我打开一个弹出窗口:

Assume I open a popup:

function pop1(){
    window.open('http://google.com','wind1');   
}

弹出窗口wind1"的url可以改成http://msn.com"吗?与 location.href 或任何其他解决方案有关的东西.

Can the url of the popup window 'wind1' be changed to say 'http://msn.com'. Something with location.href or any other solution.

推荐答案

var w1 = window.open('http://www.canop.org','wind1');

w1.location.href='http://www.google.com';

相关文章