seetherage
New Member
I can't understand what is the reason that makes these 2 scripts written in javascript behave in different ways.In case of script 1, if i execute \[code\]function f1()\[/code\], then \[code\]f2()\[/code\] and try to execute function \[code\]f3()\[/code\] afterwards, closed popup window (\[code\]w\[/code\]) doesn't open and in Firefox 19 I get error:\[quote\] Error: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMJSWindow.open],\[/quote\]In IE8 I get error:\[quote\] The object invoked has disconnected from its clients,\[/quote\]In Chrome 25 I get no errors.Execution of script 2 (\[code\]function f()\[/code\]) doesn't cause any errors in browsers, but in Firefox \[code\]f()\[/code\] makes closed popup window reopen, while in IE and Chrome the popup window (\[code\]w\[/code\]) remains closed.Could You please try these two scripts and help me to understand the reason of such strange behavior?Script 1\[code\]var w;function f1() { w = window.open("pg1.html","wind","left=0,top=0,width=480,height=480");}function f2() { w.close();}function f3() { w.open}\[/code\]Script 2\[code\]function f() { var w = window.open("pg1.html","wind","left=0,top=0,width=480,height=480"); w.close(); w.open("pg1.html","wind","left=0,top=0,width=480,height=480");}\[/code\]