KGdev

I all

I'am looking for a Jscript sample code that could help me to say when an HTML page is fully loaded.

Actually my script use the DocumentComplete event to do that, but after the DocumentComplete event from the top frame, i see other "DocumentComplete" coming from other frames.

My script has to measure Web page availability and response time (from the user point of view)

I tried several way to do that but none is really 100% reliable.

How can i be sure that the HTML Document is really Complete

Someone has a solution

Regards,

KG



Re: Internet Explorer Web Development jscript & InternetExplorer DocumentComplete

Xogede

Onload



Re: Internet Explorer Web Development jscript & InternetExplorer DocumentComplete

KGdev

Hi,

I'am using athe utomation server API "InternetExplorer.Application" and the Onload() event does not exist

Regards,
KGdev





Re: Internet Explorer Web Development jscript & InternetExplorer DocumentComplete

Xogede

Why don't you just use <body onload="..."> If you really have to report back to the server, you could well use AJAX. Besides, it'd work in all modern browsers, not just IE.



Re: Internet Explorer Web Development jscript & InternetExplorer DocumentComplete

KGdev

Hi,

Because my code is not embeded in a HTML document, it's like a standalone script which perform user action.: opening IE ,navigating, filling specific forms.......
I'am using Hp OVIS probe builder API to perform some custom measurment ( jscript api).
I can use IE event, but i still block on my first question ( how to be sure that the page is fully loaded).

KGdev





Re: Internet Explorer Web Development jscript & InternetExplorer DocumentComplete

Reza Nourai - MSFT

Are you sure you are seeing the toplevel DocumentComplete before the frame DocumentCompletes Generally speaking, the page is considered "loaded" when the top level frame has fired its DocumentComplete.

One approach to ensure every frame has fully loaded is to start off a counter object at 0, then increment it for every BeforeNavigate2 that you get, and decrement it for every DocumentComplete that you get. On the DocumentComplete event that makes it reach 0 again, you are "Fully loaded" meaning all frames have loaded as well.

Hope that helps,

-Reza





Re: Internet Explorer Web Development jscript & InternetExplorer DocumentComplete

KGdev

Hello,

I your tried your solution today and ......
the good news is that i have the same number of BeforeNavigate than DocumentComplete event
The bad news is that BeforeNavigate events from frames appears after the top frame DocumentComplete

I have seen some solution using the IDispatch interface but with VBscript but i dont know how to translate this with Jscript !!
Another WA would be to know how many frames will be loaded after the DocumentComplete event comming from the top frame, but how to do that
( i want to avoid to hard code frame number/page in my script )

KGdev




Re: Internet Explorer Web Development jscript & InternetExplorer DocumentComplete

Reza Nourai - MSFT

You should not be seeing any BeforeNavigate2 events firing after DocumentComplete. If you do, this is most likely a bug. Please let me know the URL that is displaying this behavior.

As for a WA, try monitoring NavigateComplete2 events and see if you can get more reliable events here.

-Reza





Re: Internet Explorer Web Development jscript & InternetExplorer DocumentComplete

Reza Nourai - MSFT

Oh, what version of IE are you using The behavior I mentioned is for IE7.



Re: Internet Explorer Web Development jscript & InternetExplorer DocumentComplete

KGdev

Hi,

I'am using IE6, unfortunately i cannot give any URL, its an intranet application.
may be tomorow i will post some execution trace .

Regards,
KGdev




Re: Internet Explorer Web Development jscript & InternetExplorer DocumentComplete

KGdev

Hi,

I'am using IE6, I cannot give you any URL because its an intranet application.
I will try to give you the execution trace tomorow

Regards,
KGdev