Can ayone tell me what the expected behaviour of the
following snippet is:
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:cml="http ://www.xml-cml.org/schema/CML2/Core">
<head />
<body>
<cml:cml id='mol_1'/>
<p>
<script type="text/javascript">
//<![CDATA[
var mol_1 = document.getEle mentById('mol_1 ');
var para = document.create ElementNS('http ://www.w3.org/1999/xhtml','p');
if (mol_1) {
para.appendChil d(document.crea teTextNode("Fou nd mol_1"));
}
else
{
para.appendChil d(document.crea teTextNode("Did n't find mol_1"));
}
document.getEle mentsByTagName( 'body')[0].appendChild(pa ra);
//]]>
</script>
</p>
</body>
</html>
I find that, with firefox 1.0.4, and with Deer Park alpha 1,
if the file is named:
bug.html : "Found mol_1"
bug.xhtml: "Didn't find mol_1"
bug.xml : "Didn't find mol_1"
with Konqueror 3.3.2
bug.html : "Didn't find mol_1"
bug.xhtml: "Didn't find mol_1"
bug.xml : "Found mol_1"
And finally - can anyone tell me how I can reliably
get hold of the cml:cml element in javascript?
--
Dr. Toby White
Dept. of Earth Sciences, Downing Street, Cambridge CB2 3EQ. UK
Email: <tow21@cam.ac.u k>
Comment