HTML with Scripted Elements - Potential Errors
Loading content via the <div> method requires you to load elements onto the page before the editing session begins. Given this, your content is first interpreted by the browser before Editlive is activated. This may not be the behavior desired on your editing page - running scripts meant for display. Worse, this could be a source of confusion for your user as the page loads. Note that in some browsers, the browser may re-render these items each time the user switches between Inline Editing windows.
To guard against this potentially confusing behavior, we suggest that users who expect runable content items to consider the advanced method.
The Advanced Method - setContentForEditableSection
A call to this function might look like:
editlive_js.setContentForEditableSection('div1', '<p><b>New Content</b></p>');
A full description of using the setContentForEditableSection function can be found here.
How Inline Editing Handles Content
EditLive Inline Editing stores content within a hidden HTML <textarea> element on the page, while at the same time writing out a sanitized version of the content to the specified <div> element for display. Each time a user switches between editable sections content is written out to both of these locations. When a getDocument or getBody request is received, the editor returns the value within the <textarea>.
About Inline Editing
Inline Editing allows EditLive! developers to create multiple editable sections on a page without loading several instances of the editor. A developer can create any number of <div> HTML elements and register those DIV's as editable with Editlive!. A full guide to inline editing can be found in the Developer Guide Using inline Editing Tutorial.