This function sets the contents of the EditLive! for Java applet. It will replace any existing contents of the applet with the contents the function is provided with as its parameter. This function takes a JavaScript string as its only parameter. This function will set the contents of EditLive! for Java between the <BODY> tags.
JavaScript object.SetBody(strBody)
strBody Required. The string representing the contents to be placed into the EditLive! for Java applet between the <BODY> tags.
Note: This string must be URL encoded. This can be done done using the JavaScript escape function.
The following code creates a <TEXTAREA>, named bodyContents, that will have its contents loaded into an instance of EditLive! for Java via the SetBody function. The SetBody function will be associated with a HTML button. The name of the EditLive! for Java applet is editlivejava1.
<HTML>
<HEAD>
<TITLE>EditLive! for Java JavaScript Example</TITLE>
<!--Include the EditLive! for Java JavaScript Library-->
<SCRIPT src="editlivejava/editlivejava.js" language="JavaScript"></SCRIPT>
</HEAD>
<BODY>
<FORM name = exampleForm>
<P>EditLive! for Java contents will be loaded from here</P>
<!--Create a textarea to load the applet contents from-->
<P>
<TEXTAREA name="bodyContents" cols="40" rows="10"><p>Content to be loaded</p></TEXTAREA>
</P>
<P>Click this button to set applet contents</P>
<P>
<INPUT type="button" name="button1" value="Set Contents"
onClick="editlivejava1.SetBody(escape(document.exampleForm.bodyContents.value));" >
</P>
<!--Create an instance of EditLive! for Java-->
<SCRIPT language="JavaScript">
<!--
var editlivejava1;
editlivejava1 = new EditLiveJava("eljava",450 , 275);
editlivejava1.setDownloadDirectory("editlivejava");
editlivejava1.setLocalDeployment(false);
editlivejava1.setXMLURL("sample_eljconfig.xml");
editlivejava1.show();
-->
</SCRIPT>
</FORM>
</BODY>
</HTML>
Copyright © 2001-2004 Ephox Corporation. All Rights Reserved.