Page tree
Skip to end of metadata
Go to start of metadata

This property specifies the initial document body contents of the Ephox EditLive! applet. When setting this property it should be noted that, when provided with a document, only information between the <BODY> and </BODY> tags will be retrieved and placed into the instance of EditLive!. This property is mutually exclusive with the setDocument Method


Visual Basic Script
object.Body = strBody

This attribute no longer exists in the ASP.NET controls. Please use the Content property instead.




A string specifying the initial document body contents of the EditLive! applet.

The default value is an empty string.


The following code would set the initial document body contents of EditLive! to be equal to Initial Contents of Ephox EditLive!. The <P> and </P> tags will not be seen in the window as they will be parsed as HTML. However, these tags will be visible in the Code View.

editlive1.Body = "<P>Initial contents of Ephox EditLive!</P>"

The string passed to the JavaScript setBody property must be URL encoded. It is recommended that a server-side URL encoding function be used if available as the JavaScript encodeURIComponent function does not fully comply with the URL encoding standard.

editlive_js.setBody(encodeURIComponent("<P>Initial contents of Ephox EditLive!</P>"));


The following code creates a <TEXTAREA>, named bodyContents, that will have its contents loaded into an instance of EditLive! via the SetBody function. The SetBody function will be associated with a HTML button. The name of the EditLive! for Java applet is editlive_js.

      <TITLE>EditLive! for Java JavaScript Example</TITLE>
      <!--Include the EditLive! for Java JavaScript Library-->
      <SCRIPT src="editlivejava/editlivejava.js" language="JavaScript">
      <FORM name = exampleForm>
         <P>EditLive! for Java contents will be loaded from here</P>
         <!--Create a textarea to load the applet contents from-->
            <TEXTAREA name="bodyContents" cols="40" rows="10">
               <p>Content to be loaded</p>
         <P>Click this button to set applet contents</P>
            <INPUT type="button"
               value="Set Contents"
         <!--Create an instance of EditLive! for Java-->
         <SCRIPT language="JavaScript">
            var editlive_js;
            editlive_js = new EditLiveJava("editlive",450 , 275);


The Body property is mutually exclusive with the setDocument Method.

See Also

  • No labels