Secure Global Desktop Administration Guide > Applets > areObjectsInitialized (webtop script and webtop tray applets)

areObjectsInitialized (webtop script and webtop tray applets)

Syntax

bool areObjectsInitialized()

Description

Returns true when the webtop script or webtop tray applet is fully loaded. If not fully loaded, it returns false. You can use this to ensure that you only call the webtop applet's methods once the applet is loaded. If you call an applet's methods before it is loaded, you get JavaScript errors.

This method can be used with either the webtop script applet or the webtop tray applet.

Examples

var value = null;
var loop = 0;
var webtopApplet = top.WebtopFrame.HiddenFrame.WebtopTray.document.applets["Tarantella Webtop"];

while (value == null) {
   value = webtopApplet.areObjectsInitialized();
   loop++;
   if ( loop > 10000 ) break;
}

if ( value == false) {
   alert("An error occurred. The webtop tray applet isn't available");
} 

The code waits until the webtop applet is available, displaying an error message if it isn't available within a reasonable time.

You could use code similar to this to replace the webtop with a new mechanism of your own.

Note The code doesn't form a complete example. You'll need to add your own code and adapt it to produce a working example.

Related topics