Also, when using DOMContentLoaded, is it possible to remove iFrames from
pages before their content is requested? I don't appear to be able to get
this to work at all. The iFrames never appear but I see their URLs flash
in the progress bar so Opera is still requsting them. I also tried
inserting a stylesheet into the document at the start of the javascript
(not on any handler, literally at the start, before the Body even exists,
by appending a document.createElement('style') to
document.documentElement.firstChild) that included "iframe{content:"";
display:none;}" but that didn't help either.
I understand there is a difference of opinion between Opera and other
browser vendors as to what point DOMContentLoaded should fire, but I think
Opera's approach would be more useful for user javascripts if it allowed
them to intercept replaced elements before the request is made for their
content.
And as for standardising the behaviour of DOMContentLoaded, why not do
what XMLHttpRequest has done for years and have a series of states for
page loading to cover when the document doesn't exist yet, when the body
object has been created, when the DOM has finished being built from the
HTML, when the CSS has been applied, when replaced elements are being
loaded, when they have finished loading, and when the document is
complete, etc? The entire process of page loading seems too complicated to
have simple event objects, especially when you want to allow the user to
apply user javascripts.
I know that allowing for both dynamic rendering and coping with street
HTML is problematic (for example what would happen with the state that
signals the CSS has been applied but the DOM isn't yet built - but then a
<style> element is encountered inside the <body> element?), but surely
some kind of load event with states is feasible and useful?
what does cause this problem?