![]() | |||||
|
|
avaScript From Applet
If the Ultimate Button Bar is run in a JavaScript aware browser, the applet can interact with the web page by means of JavaScript function calls. The ability to access JavaScript from the applet opens many exciting possibilities, such as the capability of controlling Dynamic HTML functions on the web page from buttons created by the applet. This documentation, which describes how to use the Ultimate Button Bar applet to call JavaScript functions, is divided into the following sections:
| ||||
|
|
equirements
The primary requirement for calling JavaScript functions from the Ultimate Button Bar is for the browser that is running the applet to be JavaScript aware. At present, there are only two known browsers that will allow JavaScript and the Ultimate Button Bar to communicate: Microsoft Internet Explorer 4.0 or higher, and Netscape Navigator 4.0 or higher. The second requirement for calling JavaScript functions is that the MAYSCRIPT applet attribute must be included in the applet tag. For example:
The MAYSCRIPT attribute gives the applet permission to call JavaScript functions on the web page. If you omit the MAYSCRIPT attribute from the applet tag, then the applet will log an error message to the Java log or Java Console whenever a JavaScript function is called from the applet. | ||||
|
|
alling Functions
JavaScript functions can be called by the Ultimate Button Bar by specifying a JavaScript function for the UBBjsInit, UBBjsStart, UBBjsStop, UBBjsEnter, UBBjsExit, or UBBinitErr applet parameter, or by specifying a javascript, jsEnter, or jsExit action in an <ACTION> tag. If a JavaScript function is defined in an <ACTION> tag, then the JavaScript function may optionally be conditioned so that it is only executed when the applet is in a specific JavaScript mode. JavaScript modes are discussed in the JavaScript to Applet documentation. | ||||
|
|
unction Format
A JavaScript function is specified for an applet parameter or an <ACTION> (see "Calling Functions" above) using the following format:
where "functionName" is the name of the JavaScript function to be called, and "parameter 1," "parameter 2," et cetera, are comma separated parameter values that are passed to the function. NOTE: The applet parameter UBBinitErr is different then the other applet parameters that specify a JavaScript function in that it has a fixed format that does not allow user defined parameters to be passed. See the parameter documentation for further information. While the Ultimate Button Bar JavaScript function call looks very similar to a standard JavaScript function call, there are some important differences that you must be aware of:
| ||||
| Copyright © 1998 by Modern Minds, Inc. | |||||