Version: (using KDE Devel) OS: Linux Hi, In this page, http://www.iscte.pt/PA/glossario.html, the underlined words, which are "dfn" elements, are supposed to have a tooltip and point to a fragment identifier. Some of them are working and some of them are not, which is very weird.
I don't know what they are supposed to do, but all the ones with a definition (title attribute) works just fine. It is just that most of them haven't got a definition.
Sorry, was a bit too quick there. Firefox seems to handle all of them. The JS code uses either the termo attribute or the contents of the dfn tag to lookup the definition. It seems it mostly those dfn's with no termo or title that has problems. Which means it is probably this line that fails somehow: termo = termos[i].innerHTML.toLowerCase().replace(/<[^>]*>/g, '').replace(/[ \n\r]+/g, ' ').replace(/^ +/g, '').replace(/ /g, ' ')
On Tuesday 29 March 2005 20:14, Allan Sandfeld wrote: > ------- Additional Comments From kde carewolf com 2005-03-29 21:14 ------- > I don't know what they are supposed to do, but all the ones with a > definition (title attribute) works just fine. > > It is just that most of them haven't got a definition. Yes, but try those elements with mozilla... It's javascript code that looks into all dfn elements and match their content with an associative array. It seems that the text nodes inside "dfn" elements, which have accentuated characters, doesn't work. So, this probably should be marked as duplicate of #102793.
On Tuesday 29 March 2005 20:23, Allan Sandfeld wrote: > ------- Additional Comments From kde carewolf com 2005-03-29 21:23 ------- > Sorry, was a bit too quick there. Firefox seems to handle all of them. The > JS code uses either the termo attribute or the contents of the dfn tag to > lookup the definition. It seems it mostly those dfn's with no termo or > title that has problems. Which means it is probably this line that fails > somehow: termo = termos[i].innerHTML.toLowerCase().replace(/<[^>]*>/g, > '').replace(/[ \n\r]+/g, ' ').replace(/^ +/g, '').replace(/ /g, ' ') The problem is that "if(termos[i].getAttribute("termo") != null)" is always true somehow.
Simple test case: <body> <dfn term="term attribute content"> DFN element with term attribute. </dfn> <dfn> DFN element without term attribute. </dfn> <script language="JavaScript" type="text/JavaScript"> var termos = document.body.getElementsByTagName("dfn"); for(var i = 0; i != termos.length; ++i) { if(termos[i].getAttribute("term") != null) alert(termos[i].innerHTML + "has attribute: " + termos[i].getAttribute("term")); else alert(termos[i].innerHTML + "has no attribute."); } </script> </body>
Fixed in 4.0.3.
Fixed even in 3.5.9.