MathEdit API Library to interact with the MathEdit tool--Embeding in Your Web

  1. Embed MathEdit to your Web

  2. Yon can use mathedit(tID) or mathedit(tID,stateStr) to define a new mathedit instance,which can be deployed in a page by passing the instance to the target <div>, <span> or <iframe> for placement.




    Example1:
    <iframe id="embed1" frameborder="0" width="850" height="480" scrolling="no"></iframe>
    <script type="text/javascript">
     var matheditWin=new mathedit("matheditWin");
     matheditWin.set("customizable","0");
     matheditWin.set("mathURL","mathedit/mathedit.html");
     matheditWin.display("embed1");
    </script>


    Example2:
    <iframe id="embed2" frameborder="0" width="350" height="280"></iframe>
    <script type="text/javascript">
     var matheditWin2=new mathedit("matheditWin2");
     matheditWin2.set("customizable","1");
     matheditWin2.set("mathURL","API/mathedit_api.html");
     matheditWin2.set("EditorSize","300,100");
     matheditWin2.set("toolbarID","tnew,topen");
     matheditWin2.set("templateID","set,s1sqrt,s2sum3");
     matheditWin2.display("embed2");
    </script>



    More Example:

    Customization Result1 Customization Result2 Customization Result3 Customization Result4 Customization Result5

  3. Get Informathion of the MathEdit Instance

  4. Edit a Math Expression by Code

    matheditWin2.editMathByCode(Str,cType)
    Str: the content code or infix code of a math expression.
    cType: the type of code ('1':content code;'2':infix code).

    Example:

    <input id="btn7" type="button" value="Display Math Expression" 
     onclick="matheditWin2.editMathByCode(document.getElementById('mcode').value,'1');" />
    

    Please input math expression code(must be content code because the value of "cType" is '1'):

    Click this button to Edit math expression.

  5. Convert Among Different Forms of Code

    Convert(Str,cType)
    Str: the content code or infix code of a math expression.
    cType: the type of conversion ('1':conversion from content code to infix code;'2':conversion from content code to presentation code;'3':conversion from infix code to content code;'4':conversion from infix code to presentation code;).

    Example:

    <input id="btn8" type="button" value="Covert from infix to MathML Content" 
     onclick="Convert(document.getElementById('mathcode').value,'3');" />
    

    Please input math expression code(must be Infix because the value of "cType" is '3'):

    Click this button to convert code form.

  6. MathEdit Infix Verison

    Example:
    <iframe id="embed5" frameborder="0" width="850" height="480" scrolling="no"></iframe>
    <script type="text/javascript">
     var matheditWin=new mathedit("matheditWin");
     matheditWin.set("customizable","0");
     matheditWin.set("mathURL","mathedit/matheditI.html");
     matheditWin.display("embed5");
    </script>