eWebEditor Home >> eWebEditor Manual V11.2 >> Developer Guide >> JavaScript API

3.7.1 Calling API methods

Before you can do anything with JavaScript you need to be able to specify which editor you want to communicate with, this is because you can place more than one editor on a page.

In order to do this you must know the name of the editor you wish to access.

<textarea name="content1" style="display:none"></textarea>

<iframe ID="eWebEditor1" src="/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>

If you have an IFRAME on your page called "eWebEditor1" with eWebEditor loaded you can access the API functions with:

// IE

eWebEditor1.<API method>

// IE, FireFox

document.getElementById("eWebEditor1").contentWindow.<API method>

 

// eWebEditor V8.0

EWEBEDITOR.Instances["content1"].<API method>

 

Sample (get value)

// IE

var html = eWebEditor1.getHTML();

 

// IE, FireFox

var html = document.getElementById("eWebEditor1").contentWindow.getHTML();

 

Note: Please avoid any JavaScript functions other than the functions described in this manual. Functions not described in this manual are subject to change in future versions.

Note: JavaScipt language is case sensitive. Please make sure of the spelling.