Whether it is possible to change the url of the pop-up window.
Suppose I open a popup window:
function pop1(){ window.open('http://google.com','wind1'); }
Can you change the URL of the pop-up window "wind1" to "http://msn.com". Something with location.href or any other solution.
P粉2041364282024-03-26 15:00:45
For me, when I only changed the end of the url (parameter part), I used a little trick: Load different urls before using new similar urls. I chose to use "about:blank", but any website URL can be used.
self.location = "about:blank"; self.location = desired_url; //this code works fine both in Mozilla Firefox as in Chrome
Please note that location = site; is the same as location.href = site.
I only use location.href to read the current url.
P粉1352928052024-03-26 10:26:29
var w1 = window.open('http://www.canop.org','wind1'); w1.location.href='http://www.google.com';