javascript - Is there a way to open a new window (applicable for onload=) in a existing window? -


so ok, following works:

w=window.open(url); w.onload=function (){}; 

but then, when want open second new window (where first new window processed function(){},i.e. becomes garbage collected) replacing first new window, tried following utterly fails:

w.location.href=url; w.onload=function (){}; 

i wondering there solution this? since onload have power on child window, should in someway have power on child-window-replacement.

yup, can load specific window using reference name.

for example, if opened window with:

 var w = window.open(url,"window1"); 

you can load url same window referencing name - second parameter. example:

 window.open(url,"window1"); 

check out: http://jsfiddle.net/jpxnc/1/


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -