Using the API from JavaScript and VBScript

To use the API from scripting languages such as JavaScript and VBScript, you need only a text editor to write your script files, and a web browser to test and run them. In addition, the web browser must support the scripting language that you use, and scripting must be enabled in the browser. If scripting is either not available or not enabled, you can display an appropriate message using the HTML tags <noscript> and </noscript>.

To use API methods from a scripting language, name the Reflection session applet on the web page, and then reference the API from your script, as described in How to use the API.

  • If the Reflection session applet and the script code are both in the same HTML file, you reference the applet's name in the current document. Many of the API examples show how this is done, including a simple example that uses JavaScript buttons to open Reflection dialog boxes.

  • If the Reflection session applet and the script code are in different HTML files--for example, the applet is in one frame of a frameset file and the script is in a different frame of the frameset--you must supply the full frame name of the applet's document from your script code. The API examples include a web page that shows how to use JavaScript in a different HTML file than Reflection.