eWebEditor Home >> eWebEditor Manual V11.2 >> Developer Guide >> Code Examples

3.10.4 Client API

This example demonstrates how to use Client API provided by eWebEditor to realize interactive operation between client and editor.

To use this code normally, please set the path of "ewebeditor.htm" to eWebEditor's actual saving path.

This example is packed in the example directory of _example/clientapi.asp(.php/.aspx/.jsp) in compressed system package.




<TITLE>eWebEditor : Demo of Client API</TITLE>

<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">

<link rel='stylesheet' type='text/css' href='example.css'>




<p><b>Navigator : <a href="default.asp">Home</a> &gt; Demo of Client API</b></p>

<p>You can use Client API provided by eWebEditor to make advanced operation of the editor. More about API, please refer to Developer Manual.</p>



<FORM method="post" name="myform" action="retrieve.asp">

<TABLE border="0" cellpadding="2" cellspacing="1">




              <INPUT type="hidden" name="content1" value="&lt;p&gt;eWebEditor - Advanced online browser based HTML Editor.&lt;/p&gt;">

              <IFRAME ID="eWebEditor1" src="../ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="550" height="350"></IFRAME>




       <TD colspan=2 align=right>

       <INPUT type=submit value="Submit">

       <INPUT type=reset value="Reset">

       <INPUT type=button value="View Source" onclick="location.replace('view-source:'+location)">





       <TD><TEXTAREA cols=50 rows=5 id=myTextArea style="width:550px"></TEXTAREA></TD>



       <TD colspan=2 align=right>

       <INPUT type=button value="getHTML" onclick="myTextArea.value=eWebEditor1.getHTML()">

       <INPUT type=button value="setHTML" onclick="eWebEditor1.setHTML('<b>Hello My World!</b>')">

       <INPUT type=button value="insertHTML" onclick="eWebEditor1.insertHTML('This is insertHTML function!')">

       <INPUT type=button value="appendHTML" onclick="eWebEditor1.appendHTML('This is appendHTML function!')">


       <INPUT type=button value="Source Mode" onclick="eWebEditor1.setMode('CODE')">

       <INPUT type=button value="Edit Mode" onclick="eWebEditor1.setMode('EDIT')">

       <INPUT type=button value="Text Mode" onclick="eWebEditor1.setMode('TEXT')">

       <INPUT type=button value="Preview Mode" onclick="eWebEditor1.setMode('VIEW')">