Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Problem with Popupwindow


Message #1 by "Arun" <arun@l...> on Wed, 6 Feb 2002 10:29:44 +0530
> Still sometime it is giving problem.
> 
> -----Original Message-----
> From: Sten Hougaard [mailto:STG@e...]
> Sent: Monday, March 04, 2002 4:43 PM
> To: JavaScript HowTo
> Subject: [javascript_howto] Re: Problem with Popupwindow
> 
> 
> 
> Hmm...
> You have just experienced one of the very bad "features" of Javascript:
> Syncronization - that is what I call it...
> Sometimes a JS statment will "say" it has been processed (it is it lets
> execution go on to next statement),
> but in fact it is NOT 100% finished.
> The issue is because the "window.open" actually starts a progress of
> fetching an URL into a new window.
> WHEN this has been done, it looks - from the javascript inteprenters 
point
> of view - like the job is done,
> but it is NOT.
> 
> what you might do is to setup a pseudo wait procedure which will check 
for
> the relevant state to appear.
> This example is a dirty code sample:
> 
> popupWin = window.open(url, name, param);
> 
> do {
> } while (popupwin.document.readyState!='complete')
> 
> popupWin.focus();
> 
> The do loop will wait for the readystate of the popup window's document 
to
> become "complete".
> I am only aware of MSIE supporting this attribute of the document tag.
> 
> Info:
> MS has defined these readystates:
> 
> 
> 
>  uninitialized
>          Object is not initialized with data.
>  loading
>          Object is loading its data.
>  loaded
>          Object has finished loading its data.
>  interactive
>          User can interact with the object even
>          though it is not fully loaded.
>  complete
>          Object is completely initialized.
> 
>  Happy scripting! :-)
> 
> 
> 
> 
> Sten Hougaard
> EDB Gruppen
> Application developer/web-designer
> 
> 
> 
> 
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or
> to unsubscribe send a blank email to
> $subst('Email.Unsub').
> 

  Return to Index