I'm not sure about the others but:
win.focus() will probaly not work until the page has loaded.  So
calling it immediately would not work unless the window has been
loaded.

Try writing the window.onload stuff to the window.

-- 
( Robert Rainwater )


On 3/4/2001, 6:37:13 PM EST, Dann wrote about "SV: [Dynapi-Dev] DynAPI layer 
techniques applied to windows":

> Hi,

> Thanks for the feedback !

> I haven't been able to debug it to the detail, but referencing a window immediately 
>returned by an open method doesn't seem reliable... I haven't been able yet to figure 
>out what you can do,
> and what you can't do :

> win = open(...), immediately followed by
> win.<method> can cause a script error, depending on conditions I haven't been able 
>to put my finger on...
> e.g. win.focus() doesn't always work...
> e.g. win.onload=<function> sometimes throws an error...
> Troubles often occur if the window is already open, trying to open it again has been 
>documented as a way to retrieve the handle to that window... but consecutive methods 
>applied to such a
> window can fail... dunno which methods do or why they do it yet...

> I tried the win.onload = <callback method to opener> and it was not reliable... 
>don't know under which conditions it fails... the only reliable method is to hardwire 
>the callback in the window
> you are opening (already in the HTML embedded scripts). Such a window would contain 
>an onLoad handler which accesses the opener to execute code in reponse :

> [code in opened window :] opener.callback(<identifier>) in which <identifier> is 
>most likely this.name, as it is the only identifier which can be matched against the 
>identifier used to open the
> window, remember the open method :
>     open(<url>,<identifier>,<window features>)

> The opener would have registered that <identifier> to a windowManager in advance, 
>together with a Function object to be executed in callback (as in a hashtable). That 
>callback can resize, move,
> focus... the opened window in reponse to its onLoad event returning the right 
>identifier.

> So far, doing it that way keeps the errors away... not really ugly, perhaps even 
>elegant in a way, but what an effort !!!

> CU,
>  Dann



> I think, just as Eytan pointed out b.t.w., that the object you get a reference to is 
>not immediately there

> example :
> ca



_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev

Reply via email to