[Javascript] List custom element properties in IE5/IE5.5?
Hakan M.
hakan at backbase.com
Tue Nov 25 03:34:17 CST 2003
Peter-Paul Koch wrote:
>> When I try a (slightly more 'friendly') version of the above script
>> in IE5/IE5.5 the "specified" attribute, among other things, returns
>> 'false' even if the property was indeed set on the element. IE5/IE5.5
>> can SOMETIMES find ONE (of many) custom attributes, but in nine times
>> out of ten, the browser crashes badly after finding that first one.
>
>
> Interesting. I think you've stumbled on a new bug. Could you please
> post a page with the script that crashes IE5? I'd like to have a look
> at the script.
Sorry, Peter. The crash occured when the script was running in our web
application, which I can't send you. Tried to recreate the crash on a
blank page, but without results. I've found IE to be crash prone on
heavy pages at numerous times before, maybe this is the case again.
> If specified doesn't work, I'm afraid your script is not going to work
> in IE5.
True, in a sense. I could have looked for the absence of the specified
attribute, if IE5 hadn't simply group everything resembling an attribute
right on the node. Now I can do a node.getAttribute('firstChild'); and I
find myself with a node (In Mozilla, naturally, i found myself with
FALSE since there is no attribute named "firstChild" on my node, but a
property called "firstChild"). I really hoped that Microsoft would know
better than doing their old world-sized array trick.
>
> I think visiting my DOM compatibility tables will help you a lot:
> http://www.quirksmode.org/dom/w3c_core.html#attributes . The bug you
> report isn't in the table yet, though (which is the main reason I'd
> like to see an example script).
From my testing, I've found the "specified" attribute to work fine i
Mozilla. It seems to set specified to true on attributes that have a
non-default value specified, may I ask why you claim the support to be
minimal? (IE6 does the same thing, with the exception that it treats all
custom node properties as "specified attributes" as well, and in my
opinion IE6 support is more broken.)
Hakan
More information about the Javascript
mailing list