A
Aaron Gray
(Please tell me if this is silly or I am barking up the wrong tree)
Can someone check this please on pre W3C DOM browsers :-
function getDocumentRoot()
{
for ( e in document.childNodes)
if ( document.childNodes[e].nodeName == "HTML")
return document.childNodes[e];
return document.body;
}
if (!document.documentElement)
document.documentElement = getDocumentRoot();
There's an html test page here :-
http://www.aarongray.org/Test/JavaScript/documentElement-test.html
There's also a test for document.getElementById() emulation here :-
http://www.aarongray.org/Test/JavaScript/document.getElementById-test.html
Many thanks in advance,
Aaron
Can someone check this please on pre W3C DOM browsers :-
function getDocumentRoot()
{
for ( e in document.childNodes)
if ( document.childNodes[e].nodeName == "HTML")
return document.childNodes[e];
return document.body;
}
if (!document.documentElement)
document.documentElement = getDocumentRoot();
There's an html test page here :-
http://www.aarongray.org/Test/JavaScript/documentElement-test.html
There's also a test for document.getElementById() emulation here :-
http://www.aarongray.org/Test/JavaScript/document.getElementById-test.html
Many thanks in advance,
Aaron