i have a frame element, whose src is a local .xhtml file, whose onload runs a script:
// create some content
var docFragment = content.createDocumentFragment();
if (docFragment)
contentBody.appendChild(docFragment);
where contentBody is a div in the frame's document. the content may contain images or such which load external links and thus are slower. immediately after the appendChild, some calculations on the page size are done, and if there is an image, its load will wreck these calcs once it reflows the page and thus i need to wait for a load event.
how to do this? it seems load is fired on setting a frame's src = someurl, which i'm not doing. no element to which attaching an addEventListener("load", myFunc) worked. setTimeout would be extremely inelegant and imprecise fwiw.