Standard browser scripts are very restricted as to their input: they mostly operate on the HTML in the current web page, and have no native means of accessing other data. HTML itself however has a couple of mechanisms for loading external documents, which can be used as proxies for a script.
This loads text from an external file into an invisible
object, processess it, and displays it in a different part of the web page.
HTML could also be similarly obtained as text or traversed as an object tree.
At the time the main document is loaded, any child
referring to an external document is empty. This is because if the external
document takes time to download, the rest of the document should be
onload attribute of the iframe can be set to execute a
function when the document arrives. So the trick is to set a timer to wait
until this event fires, then to get and render the iframe contents.
Doesn’t support all the DOM calls one would like, but there are work-arounds.
Version 3.x assumes that if the
display style of the
is set to
none, then we didn’t want the contents anyway, so
it goes ahead and fires the
onload event, but doesn’t provide
access to the contents (
contentDocument of object is null).
Reported: Konqueror bug #141787.
But in JS case seems also not to trigger onload().
All text and buttons following the iframe are lost, even when the main script works, or even if it has been commented out! Mea culpa: I was using a self-terminating iframe tag, which it grokked not.
But seems also not to trigger