setPreload Property

Description

This property can be used when preloading EditLive! for Java.  Once EditLive! for Java has finished loading the JavaScript function defined by the setPreload property is used as a callback.

Syntax

JavaScript object.setPreload(strCallback)

Parameters

strCallBack Required.  A string specifying the name of a JavaScript function to use as a callback once EditLive! for Java has finished loading.

Example

The following code would preload the JVM and EditLive! for Java classes and then alert the user that EditLive! for Java has finished loading by using the preloadReturn callback function to create a JavaScript alert dialog.  

<script language="javascript">
...
var editlivejava1;
editlivejava1 = new EditLiveJava("ELJApplet1","1","1");
editlive1.setDownloadDirectory("redistributables/editlivejava");
editlive1.setXMLURL("redistributables/editlivejava/sample_eljconfig.xml");
editlive1.setBody("&nbsp;");
editlive1.setPreload("preloadReturn");
editlive1.show();

function preloadReturn(){
    alert("EditLive! for Java has completed preloading.");
}
...
</script>

Remarks

The setPreload property can be used to assist with the preloading of EditLive! for Java.  This can better the performance of EditLive! for Java within a Web application.  Preloading EditLive! for Java causes the browser's Java Plug-In and the EditLive! for Java classes to be loaded.

It is recommended that, when preloading EditLive! for Java, you set the height and width of the EditLive! for Java applet so they are both one pixel.  This will ensure that the EditLive! for Java applet is not visible on the page.

Preloading EditLive! for Java can be performed on any page within a Web application.

See Also