Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Sun, 28 May 2006 07:19:01 -0700,    group: microsoft.public.inetsdk.programming.scripting.jscript        back       


window "readyState"?   
Windows do not have a readyState property, but as a document container I need 
a way to determine whether a document is instantiated.  

After a .navigate I can check the readyState of InternetExplorer or the 
WebBrowser control to see if it is safe to start working with the .document.  
With a window (and frame as window) I can find now way to do the same.  

Am I missig something or am I forced into having to trap errors trying to 
reference the document object?

Thanks,

Dale
date: Sun, 28 May 2006 07:19:01 -0700   author:   DaleH

Re: window "readyState"?   
"DaleH"  wrote in message
news:D7CFEF8D-9DC8-4C12-AC52-5724BABF58D8@microsoft.com
> Windows do not have a readyState property, but as a document
> container I need a way to determine whether a document is
> instantiated.
>
> After a .navigate I can check the readyState of InternetExplorer or
> the WebBrowser control to see if it is safe to start working with the
> .document. With a window (and frame as window) I can find now way to
> do the same.

I'm not sure I understand your question. You get NavigateComplete2 event 
when the first byte of the response has arrived. At this point, you have 
access to window and document objects, but the DOM underneath the 
document is incomplete. Once DocumentComplete event arrives, the 
document is fully loaded and you can work with the DOM.

You get these events from each frame independently (one of parameters to 
these events tells you which frame the event has come from).
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Sun, 28 May 2006 10:36:01 -0400   author:   Igor Tandetnik

Re: window "readyState"?   
It's not a traditional application where I have full control over logic and 
flow, but rather a set of generalized scripting routines.  I have a function 
called _IELoadWait that accepts an object reference and then loops waiting 
for the appropriate objects to quiesce befor returning.

So the logic does not allow me to monitor event delivery on the object.  
InternetExplorer, WebBrowser and Document all have a .readyState property 
that I can check and when it is "complete" or 4 I can move on.  After a 
..navigate, readyState for InternetExplorer and WebBrowser do not change to 
complete until the document object they contain is accessible (I then wait 
for the readyState of the document to complete as well).  I need a way to do 
the same starting with a window object.

Make sense?

Dale
date: Sun, 28 May 2006 08:08:01 -0700   author:   DaleH

Re: window "readyState"?   
"DaleH"  wrote in message
news:7C5A37BD-8833-472C-A998-67A1BF07F68F@microsoft.com
> So the logic does not allow me to monitor event delivery on the
> object. InternetExplorer, WebBrowser and Document all have a
> .readyState property that I can check and when it is "complete" or 4
> I can move on.  After a .navigate, readyState for InternetExplorer
> and WebBrowser do not change to complete until the document object
> they contain is accessible (I then wait for the readyState of the
> document to complete as well).  I need a way to do the same starting
> with a window object.

If you have a window, you also have access to the document via 
window.document, at which point you can use readyState.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Sun, 28 May 2006 11:17:17 -0400   author:   Igor Tandetnik

Re: window "readyState"?   
Correct, but there is a period in time where window.document.readyState 
returns "requested action with this object has failed".  This is what I am 
trying to avoid.  When I start with an InternetExplorer object I can check 
InternetExplorer.readyState first... if it is ready I never get an error with 
InternetExplorer.document.readyState -- I'm trying to replicate this logic 
starting with a window.

Dale
date: Sun, 28 May 2006 08:49:01 -0700   author:   DaleH

Re: window "readyState"?   
"DaleH"  wrote in message
news:D374539D-CC96-4CC3-A669-1E7DA0D54E10@microsoft.com
> Correct, but there is a period in time where
> window.document.readyState returns "requested action with this object
> has failed".  This is what I am trying to avoid.  When I start with
> an InternetExplorer object I can check InternetExplorer.readyState
> first... if it is ready I never get an error with
> InternetExplorer.document.readyState -- I'm trying to replicate this
> logic starting with a window.

OK, try this. Query the window (or document, should work for either) 
object for IServiceProvider, call QueryService with SID_STopLevelBrowser 
to get IWebBrowser2 interface for the top-level browser. You can also 
use SID_SWebBrowserApp to get IWebBrowser2 for immediately enclosing 
browser object (may be top-level browser or a frame).
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Sun, 28 May 2006 17:53:55 -0400   author:   Igor Tandetnik

Re: window "readyState"?   
Thanks Igor.  I appreciate your attentiveness to these forums and your 
thoughtful resonses.

I was hoping I was missing something obvious in the object model.

Dale
date: Mon, 29 May 2006 15:21:01 -0700   author:   DaleH

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us