本文介绍如何在弹出窗口中打开iMathEQ数学公式编辑器:
你可以用下面的内容创建一个新网页
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"//www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="//www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>iMathEQ | Online Mathematics Equation Editor</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="icons/favicon.ico">
<script src="//code.jquery.com/jquery-latest.min.js"></script>
<script type='text/javascript' charset = "utf-8" src='//www.imatheq.com/imatheq/com/imatheq/scripts/imatheqfunctions.js'></script>
<script type="text/javascript" charset = "utf-8" >
var editor;
window.onload=function () {
editor = org.imatheq.formulaeditor.createEditor(document.getElementById('myEditor'), "[LICENSE KEY]", "EN");}
</script>
</head>
<body>
<div id="myEditor" class="imatheqvisibletextarea"></div>
<input type="button" onclick="#" value=Save>
</body>
</html>
将以上内容存储为新的HTML页面,并使用window.open打开它。用户可随意调整弹出窗口的大小。
在上面的html代码中,您可以在createEditor()函数中指定iMathEQ编辑器所用的语言:
“IN” - 英语, “ZH-CN” - 简体中文。将很快支持更多语言。
许可证密钥将在您购买或索取免费试用后通过电子邮件(support@imatheq.com)发送给您。您需要用它来代替以上所下载或电邮的editor.html中的[LICENSE KEY]。
调用以下编辑器API来获取MATHML:
alert(editor.getMathML());
调用以下编辑器API来设置MATHML:
alert(editor.setMathML(""));
调用以下编辑器API来获取PNG图片:
editor.getImage();
调用API后,您可以通过<img src="API返回的图片">将其添加到您的网页。您也可以通过调用您的服务器代码将其保存到您的服务器。