Subj : Re: race condition? window.open return value references self??? To : netscape.public.mozilla.jseng,netscape.public.mozilla.dom From : =?ISO-8859-1?Q?Georg_Maa=DF?= Date : Mon Feb 02 2004 09:38 am Fritz Schneider wrote: > When I was checking to see what objects are protected by the same > origin policy, I noticed that the following script > > var w = window.open("http://www.yahoo.com"); > w.onresize = function() { document.body.style.backgroundColor='red'; }; > > turns the window the script is in red. (Similar effect if you do an > alert()). If instead you set the handler in a setTimeout for a short > period of time, it has the expected behavior (having no effect). > > I also noticed that if you immediately read w's properties you can get > screen x and y positions, the size of the window, and so on. Also you > can get an HTMLBodyElement by reading w.document.body as well as other > objects. > > If it's referencing an uninitialized window, why would the onresize > get attached to the current document? If it's not, what gives? > > Thanks! Wrong group. The objects related do not belong to JavaScript, they belong to the host. So netscape.public.mozilla.dom fits better. XPOST & FUP -- Georg Maaß - bioshop.de D-76227 Karlsruhe, Westmarkstraße 82 HTML, XML / JavaScript, C++, Java, PHP, VB / CGI, JSP, ASP, ASP.net - The ultimate DHTML engine: http://gml-modul.sourceforge.net - http://sourceforge.net/projects/gml-modul .