Re: RFC: Building the Perfect Tabbed Pane (an tutorial article)
- From: Peter Michaux <petermichaux@xxxxxxxxx>
- Date: Wed, 13 Feb 2008 10:46:44 -0800 (PST)
On Feb 13, 3:32 am, David Mark <dmark.cins...@xxxxxxxxx> wrote:
On Feb 13, 3:40 am, Peter Michaux <petermich...@xxxxxxxxx> wrote:
David Mark wrote:
On Feb 12, 10:26 pm, Peter Michaux <petermich...@xxxxxxxxx> wrote:
[snip]
If execution has reached this stage, then doc.createElement should be
tested to work. I have a feature test at the top for the existence of
document.createElement. I could add a test there that it also works
and a comment that it may be overly paranoid. I'm not being that
paranoid in other cases. I'd like the article to point out that you
can actually test things work as well as just testing they exist so
this may make a good example.
By habit, I have always tested the return value of createElement. It
may not be necessary. My original thinking was along the lines of a
browser that is out of resources and cannot create a new element.
Perhaps it would return null in that case (or perhaps it would just
blow up.)
That is overly paranoid! ;-)
I suppose the test could go with the cssDisplaySupport, because if the
browser has decided this late in the game that it isn't going to make
any more elements then that time for the check is before any elements
for the tabbed pane are created.
There are quite a few kinds of widgets that, when passed the point of
no return, require successful createElement calls to be successful.
There is almost no point in testing the calls worked at that late
stage in the game. I suppose an attempt to back out of the widget to
the static version could be made. An error message saying "you
computer has very little memory...upgrade." might help.
[snip]
Better to add the needed rules via DOM
manipulation. Of course, that logic must reside in a script block
outside of the head element, else you risk the dreaded "Operation
Aborted" error in IE.
Officially, the DOM is supposed to be read only until window.onload. I
According to whom?
The only reference I can find right now is
<URL: http://www.devguru.com/technologies/xmldom/quickref/document_readyState.html>
I don't see anything on the Microsoft site about the DOM being read-
only in this state. I may just be wrong about this.
Personally, I don't touch the body element until
the document has completed parsing, but adding style elements to the
head shouldn't be an issue as long as the script is after the closing
head tag.
don't want to touch it in any way. I like following the rules. I'm
sure the people that started seeing that Operation Aborted error
didn't know what to do for a long time and the only reason they saw it
was because they didn't follow the rules.
No, it is a documented bug in IE6. I don't know if it exists in IE7
or not.
I believe IE7 does have it and that I've seen it. That was quite a
while ago so my memory may be wrong.
I've never run into it, except when testing third-party
scripts. It is caused by attempting to manipulate elements that
haven't been fully parsed.
The only sanctioned thing that can be done while the page is loading
is document.write to dynamically generate parts of the page.
I've never heard of such a rule and certainly nobody conforms to it
(or enforces it.) What would be the point of DOMContentLoaded if you
had to wait for the load event?
I always figured that DOMContentLoaded was a proprietary extension
that was early permission to the developer that even though the
standard says to wait, it is actually ok to start manipulating now. It
looks like I was wrong about the read-only part, however.
Peter
.
- References:
- RFC: Building the Perfect Tabbed Pane (an tutorial article)
- From: Peter Michaux
- Re: RFC: Building the Perfect Tabbed Pane (an tutorial article)
- From: David Mark
- Re: RFC: Building the Perfect Tabbed Pane (an tutorial article)
- From: Peter Michaux
- Re: RFC: Building the Perfect Tabbed Pane (an tutorial article)
- From: David Mark
- RFC: Building the Perfect Tabbed Pane (an tutorial article)
- Prev by Date: Re: onload does not work in IE7
- Next by Date: Re: RFC: Building the Perfect Tabbed Pane (an tutorial article)
- Previous by thread: Re: RFC: Building the Perfect Tabbed Pane (an tutorial article)
- Next by thread: Re: RFC: Building the Perfect Tabbed Pane (an tutorial article)
- Index(es):
Relevant Pages
|