This function retrieves the contents of the EditLive! for Java applet. It will retrieve all contents which lie between (and including) the <HTML> tags. This function takes the name of a JavaScript function as its only parameter.
JavaScript object.GetDocument(jsFunct,[bUploadImages])
jsFunct Required. The name of the JavaScript function which receives the retrieved EditLive! for Java applet contents. bUploadImages Optional. This is a boolean which indicates whether images should be uploaded to the server when this function is called. The uploading of images will occur immediately before the content is retrieved.
Default: false
The following code first creates a JavaScript function which is to be used as the parameter for the GetDocument function. The JavaScript function will save the retrieved contents to a <TEXTAREA> with the name documentContents. The GetDocument function will be associated with a HTML button. The name of the EditLive! for Java applet is editlivejava1. Images in EditLive! for Java will be uploaded to the server when GetDocument is called.
<HTML>
<HEAD>
<TITLE>EditLive! for Java JavaScript Example</TITLE>
<!--Include the EditLive! for Java JavaScript Library-->
<SCRIPT src="editlivejava/editlivejava.js" language="JavaScript"></SCRIPT>
<SCRIPT language="JavaScript">
<!--
function retrieveDocument(src){
document.exampleForm.documentContents.value = src;
}
-->
</SCRIPT>
</HEAD>
<BODY>
<FORM name = exampleForm>
<P>EditLive! for Java contents will appear here</P>
<!--Create a textarea to save the applet contents to-->
<P>
<TEXTAREA name="documentContents" cols="40" rows="10"></TEXTAREA>
</P>
<P>Click this button to retrieve applet contents</P>
<P>
<INPUT type="button" name="button1" value="Retrieve Contents"
onClick="editlivejava1.GetDocument('retrieveDocument',true);" >
</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.setDocument(escape('<html><body><p>Some initial text</p></body></html>'));
editlivejava1.show();
-->
</SCRIPT>
</FORM>
</BODY>
</HTML>
When uploading locally stored images to the relevant Web server for an instance of EditLive! for Java ensure that the bUploadImages parameter is set to true when calling the GetDocument function.
Copyright © 2001-2004 Ephox Corporation. All Rights Reserved.