DKM
2005-05-16 02:34:19 UTC
I need an equivalent for the following:
document.getElementById('equation').update(); from Mathplayer
to use it in Mozilla based browser.
When I change any text node, the page updates just fine in FireFox.
However, if I change an entire math element, as in the following:
eqElement = document.getElementById("equation");
a2Element = document.createElement("msup");
baseElement = document.createElement("mi");
powerElement = document.createElement("mo");
baseElementText = document.createTextNode("a");
powerElementText = document.createTextNode("2");
baseElement.appendChild(baseElementText);
powerElement.appendChild(powerElementText);
a2Element.appendChild(baseElement);
a2Element.appendChild(powerElement);
eqElement.appendChild(a2Element);
it does not update the page.
It does not update in Internet Explorer running Mathplayer either.
However, if I follow up the above code with the following:
document.getElementById('equation').update();
it works just fine.
The file is a XML file with the following declaration:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"
[<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
]>
<html xmlns="http://www.w3.org/1999/xhtml">
I will appreciate it if someone can she some light on this.
Thanks in advance.
D. K. Mishra
document.getElementById('equation').update(); from Mathplayer
to use it in Mozilla based browser.
When I change any text node, the page updates just fine in FireFox.
However, if I change an entire math element, as in the following:
eqElement = document.getElementById("equation");
a2Element = document.createElement("msup");
baseElement = document.createElement("mi");
powerElement = document.createElement("mo");
baseElementText = document.createTextNode("a");
powerElementText = document.createTextNode("2");
baseElement.appendChild(baseElementText);
powerElement.appendChild(powerElementText);
a2Element.appendChild(baseElement);
a2Element.appendChild(powerElement);
eqElement.appendChild(a2Element);
it does not update the page.
It does not update in Internet Explorer running Mathplayer either.
However, if I follow up the above code with the following:
document.getElementById('equation').update();
it works just fine.
The file is a XML file with the following declaration:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"
[<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
]>
<html xmlns="http://www.w3.org/1999/xhtml">
I will appreciate it if someone can she some light on this.
Thanks in advance.
D. K. Mishra