Overview - AppletsThe MathFlow SDK Editor applets enable you to obtain mathematical input from readers using standard JavaScript and CGI techniques (similar to those for obtaining text input from ordinary HTML form elements like text areas, pulldown menus, etc.). Typical applications for the MathFlow SDK Editor applets include the following:
As described below, there are five typical steps to be performed when authoring content using the MathFlow SDK Editor applets.
Setting Applet Parameters In addition to standard attributes common to all applets (e.g., codebase), the MathFlow SDK Editor applets also recognize a number of special, optional parameters. You can customize the MathFlow SDK Editor applets by setting the optional parameters. The MathFlow SDK Editor applet parameters naturally divide into three groups:
Complete descriptions of all parameters and their legal values are given in Applet Parameters. Writing JavaScript Handlers JavaScript is the primary way of querying a MathFlow SDK Editor applet for the MathML markup of the equation it is currently displaying. Thus, integrating the MathFlow SDK Editor applets into your Web applications nearly always requires JavaScript programming. The basic procedure is fairly simple. First, place an HTML control, such as a "submit" button, in your page, and specify a JavaScript handler for it. Then, in the JavaScript handler function, use the MathFlow SDK Editor applet API functions to request the MathML markup for the current equation. Once the handler function has retrieved the MathML from the MathFlow SDK Editor applet, it is usually necessary to send it back to a Web server for processing. The easiest way of doing so is to have the handler function request the URL of the processing script directly, passing the MathML as an argument to the script. Another common strategy is to store the MathML in a hidden field of a normal HTML form. When the form is submitted, the MathML is then sent along with the rest of the form data. For simple tasks, it is often possible to process the MathML using JavaScript within the handler function without going back to a Web server. While client-side processing generally gives a much better user experience than server-side processing, parsing MathML with JavaScript rapidly becomes complex. On a Mac operating system, with browsers other than the Firefox/Mozilla/Camino browsers, it is not possible to use JavaScript to query the editor. As a workaround, the MathFlow SDK Editor applet automatically detects when it is running on a Mac, and adds controls to its user interface for sending input directly to a CGI script. See Mac Only Applet Parameters for more discussion of the techniques involved. Processing MathML and Returning Results The techniques for processing MathML and returning results are standard. Main examples include the following:
| ||||||||
Copyright © 1996-2016 Design Science, Inc. All rights reserved. |