Inserting MathML into DOM Tree

This demo shows how dynamically retrieved MathM (via Javascript XMLHttpRequest), is made into a DOM node and instered into the DOM tree of this page.

Note that this page is .xhtml and therefore an XML document (type application/xhtml+xml) rather than an HTML document (type text/html). Note the DOCTYPE used as well.

Here is a mixed-mode MathML displayed

100x + 3-x 4 - π 9 =x3 -19π 14 3 -1x 12 100x x3 sqrt(-x+3)/4 + 100*x - PI/9 = x^3

To try the demo, enter an infix expresson and click the convert button.

The URL (get request)

The get request to obtain your conversion is shown below

 

The Display

The result of the converted MathML displayed by Mozilla, Firefox or Netscape with math fonts loaded:

 

Use view selection source to see the source MathML generated which contains both Presentation code and Content code.

See this javascript file for the dynamic actions.