Event Handler Sample
Append Data using the ONDATALOADED Event Handler
This sample shows the usage of the editor's ONDATALOADED Event Handler. The event defined with this Event Handler will be executed after content has been loaded into edit-on Pro 5. The following editor will additionaly load some content after the first piece of content has been loaded directly after initializing the editor.

edit-on Pro's OnDataLoaded Event Handler was set as follows within the applet's JavaScript configuration:

<script type="text/javascript>
eop = new editOnPro(898, 400, "eop_inst1", "myId", "eop");
......
// The setHTMLData JavaScript API loads content into the editor 
// after it has finished initalizing.
eop.setHTMLData("<p>This text is automatically loaded when the applet has finished initializing...</p>");

// Using the ONDATALOADED Event handler, the JavaScript function "OnDataLoaded()" 
// will be called by the applet. This function inserts another piece of sample content.
eop.setEventHandler("ONDATALOADED","OnDataLoaded");
....
</script>
									            
Back to Samples Index