html code만 있는 경우 ¶
html + java script ¶
/* March 19, 2004 MathHTML (c) Peter Jipsen http://www.chapman.edu/~jipsen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
(at http://www.gnu.org/copyleft/gpl.html) for more details.*/
function convertMath(node) {// for Gecko
if (node.nodeType==1) {
var newnode =
document.createElementNS("http://www.w3.org/1998/Math/MathML",
node.nodeName.toLowerCase());
for(var i=0; i < node.attributes.length; i++)
newnode.setAttribute(node.attributes[i].nodeName,
node.attributes[i].nodeValue);
for (var i=0; i";
}
node = node.nextSibling;
node.parentNode.removeChild(node.previousSibling);
}
str += "";
newnode = document.createElement("span");
node.parentNode.replaceChild(newnode,node);
newnode.innerHTML = str;
}
}
모든 소스 코드 c&p ¶
MathML in HTML files
Peter Jipsen,
Chapman University, March 2004
MathML in HTML files for Netscape7/Mozilla/Firefox and IE+MathPlayer
This file loads a separate small script that inserts the MathML in the DOM.E.g.
To get a copy of this page that works locally, use View->Source, then copy and paste the html text into a local .html file. (If you use File->Save As..., your browser may not save the correct header information.) Check that your file is viewable with Netscape 7+ (or other Gecko based browsers) as well as with IE+MathPlayer on MS Windows.
Technical Note: this method of displaying MathML in Netscape/Mozilla/Firefox does not recognize all entity names in the MathML DTD, but only those that are in the HTML DTD (see HTMLsymbol.ent or HTMLsymbol.ent.txt). To get access to all symbols, use numeric entity names (e.g. ∮ for ∮).