KHTML and onLoad

Tobias Anton TA at ESC-Electronics.de
Mon Sep 27 12:03:50 BST 2004


On Sonntag, 26. September 2004 13:25, Sébastien Richard wrote:

> If I run this with kdedebug enabled, I can see that I get the signal
> completed()  BEFORE the HTTP GET query for page3.html.
> And I receive the signal completed() not the signal
> completed(pending=true). Is this a bug ?

Don't think so. Provided that page1.html and page2.html are loaded completely, 
KHTML correctly assumes that the page is finished loading. The semantics of 
the JavaScript "onLoad"-listener is identical to that of the QT-signal 
"completed()". These two events happen virtually synchronously and they don't 
depend on each other's result. How should they? Imagine for example the 
following function being called in onLoad:

function loadFramesLater()
{
	window.setTimeout("loadFrames", 1000);
}

In that case, completed() would adequately be emitted on load, but a second 
later, we'd have to "revoke" it, because then, we're in progress of loading 
again.

> Is there any other variable that
> could indicate me that the loading is not finished ?

It should work with a little cross-frame scripting. You could for example put 
onLoad="parent.setCompleted()" in the body of page3.html. Don't know what to 
tweak additionally to get it working, though.

Cheers
Tobias




More information about the kfm-devel mailing list