BACK
HOME

MATHADOR

Viewer Example that interact with Javascript

This demo uses a jar not signed because it does not use the client’s local disks space for saving or loading


Write a new MathML code:

Click me for viewing the MathML Code
Click me for setting the bgcolor of the expression to lime
In order to include this applet in a web page, you can use the following tag:

<applet id="mathador" align="middle" code="mathador/MathWebViewer.class" archive="../software/mathador_unsigned.jar" width="139" height="51">
  <param name="mathml_dtd" value="http://put_server_host_ip_address_here/mathador/software/mathml_dtd/mathml2/mathml2.dtd"/>
  <param name="source_string" value="<math><mi>x</mi><mo>+</mo><mn>2</mn><mo>+</mo><mn>1936.27</mn></math>"/>
</applet>

The most relevant attribute is the id="mathador" that allows to reference the applet from the Javascript code.
An example of Javascript code which can change the MathML code on the fly is the following:

<form id="form1">
  Write a new MathML code:   <input type="text" name="code" value="<math><mi>ciao</mi></math>" size="30"/>
  <input type="button" name="button1" value="CHANGE MATHML" onClick="document.mathador.setCode(code.value)"/>
</form>

In a similar way it is possible to use all the public members of the applet class.
by Valentino Santucci