T
Toby White
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.getElementById('mol_1');
var para = document.createElementNS('http://www.w3.org/1999/xhtml','p');
if (mol_1) {
para.appendChild(document.createTextNode("Found mol_1"));
}
else
{
para.appendChild(document.createTextNode("Didn't find mol_1"));
}
document.getElementsByTagName('body')[0].appendChild(para);
//]]>
</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?
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.getElementById('mol_1');
var para = document.createElementNS('http://www.w3.org/1999/xhtml','p');
if (mol_1) {
para.appendChild(document.createTextNode("Found mol_1"));
}
else
{
para.appendChild(document.createTextNode("Didn't find mol_1"));
}
document.getElementsByTagName('body')[0].appendChild(para);
//]]>
</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?