Contents | Index | Previous | Next

Appendix B: Quick intro for users of Java API

JavaScript code on an HTML page is a part of JavaScript object Window. Effectively, windows can be used as applications' interfaces. A piece of script reading webwisdom.tango.TAgentJS.createTAgentJS() registers in Tango and creates TAgentJS object, equivalent of Java TAgent. The call takes one argument - a window that will be used to close the application. Similarly, other listeners, for receiving specific types of messages, can be added as windows representing JavaScript code with appropriate interface functions.

All method names of JavaScript proxy for Tango, TAgentJS are the same as in Java, except that they end with 'JS' suffix. Conversely, public methods that do not use this suffix are not designed for JavaScript use. In methods' arguments and return types, netscape.javascript.JSObject replaces types unavailable in JavaScript. The conversion is done according to the following key:

jsapi00090000.gif Java String object becomes JavaScript String object,

jsapi00090000.gif Java array becomes JavaScript Array object,

jsapi00090000.gif Java primitive type boolean becomes JavaScript Boolean object.