Home

Example 7 - Load Editor on Request (jQuery)

This example demonstrates how we can load the editor on request, using the event when a button is pressed.


Key HTML Code

<!DOCTYPE html>
<html lang="en">
<head>
<title>Example 7 - Load Editor on Request (jQuery)</title>

<!-- Scripts needed by CodeCogs Equation Editor -->
<link rel="stylesheet" type="text/css" href="http://latex.codecogs.com/css/equation-embed.css" />
<script type="text/javascript" src="http://latex.codecogs.com/js/eq_config.js" ></script>
<script type="text/javascript" src="http://latex.codecogs.com/js/eq_editor-lite-18.jss" ></script>
<script type="text/javascript" src="http://www.codecogs.com/js/jquery-1.8.2.min.js" ></script>
<!-- End of Scripts needed -->

<script type="text/javascript">
$(document).ready(function()
{

$('#loadeqneditor').click(function(){
EqEditor.embed('editor','things','mini','en-us');
EqEditor.add(new EqTextArea('equation1', 'entry'),false);
});

});
</script>
</head>
<body>
<button id="loadeqneditor">Load Equation Editor</button>
<div id="editor"></div>
<textarea id="entry"></textarea>
<p><img id="equation1" /></p>

© 2004-2015 www.CodeCogs.com, Zyba Ltd.