On 6 Nov 2006, at 20:19:36, Thierry Koblentz wrote:

Demo:
http://www.tjkdesign.com/articles/TJK_abbr_demo.asp
Article:
http://www.tjkdesign.com/articles/how_to_expand_abbreviations.asp

I'd appreciate any comment that would help me improve this solution.


Not sure if this would help improve it, but it hopefully explains the following: "It appears that Internet Explorer (prior to version 7) is seriously ABBR-challenged as I could not find a way to get the nodeValue of these elements. "

(Aside: elements have a nodeValue of "null" as per DOM Level 1:
<http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one- core.html#ID-1950641247> I'm assuming you were referring to the nodeValue of the text node children of the element.)

That's because IE<7 doesn't support ABBR, and instead parses the page into a DOM containing a superfluous element with an invalid name. To be precise, when dealing with

some text <abbr>ABC</abbr> some more text

rather than producing:

{text node}some text {end of text node}
{element name="ABBR"}
   {text node}ABC{end of text node}
{end of element}
{text node} some more text{end of text node}

it will produce:

{text node}some text {end of text node}
{empty element name="ABBR"}
{text node}ABC{end of text node}
{empty element name="/ABBR"}
{text node} some more text{end of text node}

thus creating an empty element with the name "ABBR", another empty element with name "/ABBR", and not wrapping the contents of ABBR but instead leaving them at the same level as the empty elements.

Some more on this here:
<http://www.nickfitz.co.uk/2005/05/17/obscure-internet-explorer- bugs-1-of-who-knows/> (Although I still haven't produced the follow-up I mention in the last paragraph, IE behaves the same way with any unknown tag).

You might therefore be able to get it working for IE<7 by using conditional comments to include a script file with an alternative definition of the function that gets the value of the element's children, which takes account of this and scans the following- siblings of the ABBR element looking for the /ABBR element.

Also, Dean Edwards (Whom God Preserve) found a way of using namespaces to force IE to behave:
<http://dean.edwards.name/my/abbr-cadabra.html>

Regards,

Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/





*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to