On 2008-10-21 18:56, Dr J R Stockton wrote:
It does work in Opera (opera_9.61.245 6.gcc4.qt3_i386 ).
The loop is never entered because PT is an empty node list (you can
confirm this by reading PT.length). You already know why it's empty:
As you said, "name" attributes aren't allowed in <tdelements (and the
page won't validate as HTML 4.01 Strict, either). It would appear that
IE doesn't recognize those non-standard attributes and thus won't return
the elements with getElementByNam e().
The usual solution is to assign CSS classes and use something like
getElementsByCl assName, which will have to be retrofitted for some
browsers. Microformats in HTML work the same way; they (mostly) use
class names to add semantic information to generic markup:
As a side note, I also found your code very hard to read; you will know
what variables like PT, J, T, and functions like BB and LZ are supposed
to represent, but I didn't, and if your script had been any longer than
this, I wouldn't have bothered to look at it.
- Conrad
The page below works in Firefox & Safari, but not in IE & Opera.
Tests in IE suggest that PT is indeed set to an Object, but that the
loop is never entered - T is false on the first entry.
loop is never entered - T is false on the first entry.
confirm this by reading PT.length). You already know why it's empty:
TIDY shows three like
line 29 column 5 - Warning: <tdproprietar y attribute "name"
which explains what is wrong.
line 29 column 5 - Warning: <tdproprietar y attribute "name"
which explains what is wrong.
page won't validate as HTML 4.01 Strict, either). It would appear that
IE doesn't recognize those non-standard attributes and thus won't return
the elements with getElementByNam e().
Best would be something that can mark for action any element suitable
for containing a datetime (TH, TD, SPAN, ...?) but not to search the
body for any datetime.
for containing a datetime (TH, TD, SPAN, ...?) but not to search the
body for any datetime.
getElementsByCl assName, which will have to be retrofitted for some
browsers. Microformats in HTML work the same way; they (mostly) use
class names to add semantic information to generic markup:
As a side note, I also found your code very hard to read; you will know
what variables like PT, J, T, and functions like BB and LZ are supposed
to represent, but I didn't, and if your script had been any longer than
this, I wouldn't have bothered to look at it.
- Conrad
Comment