User Guide

Chapter 6 Connecting to Content
53
Connecting to content using the RoboAPI.js API
RoboEngine includes a simple JavaScript file named RoboAPI.js that you can
use to connect your content to the engine.
A .JS file is a JavaScript file that contains a list of the RoboEngine functions.
These functions are used to invoke the engine. The file works by including the
functions within the content to launch or "call" the engine.
Note: In order to access the functions in RoboAPI.js, you need to include the
file in your HTML files. Add the following HTML code within the <HEAD>
section of your HTML source code:
<script language="JavaScript" name="RoboAPI"
src="/ScriptsPath/RoboAPI.js"> </script>
Advanced window control
If you want advanced window control, you can use the JavaScript file named
RoboAPI.js. This JavaScript file contains a single function named
"RoboWindow." This function allows you to display content in a new window
created with the size and position specified by the window properties. The
arguments to this parameter are:
RoboWindow(server, type, data, window)
n Server: Denotes the server to address such as http://ehelp.com
n Type: One of two values - 'project' or 'url'
n Data: This is either the project or url
n Project: Name of project as specified in RoboInfo Publisher
n URL: Topic or relative path to the HTML file you want to invoke
n Window: This parameter is optional. When the type "URL" is specified, this
is the window in which the URL is displayed.
JavaScript (JS) call example
In the install folder (C:\Program Files\ RoboEngine\) there is a Script folder that
contains a file called "RoboAPI.js". This file is used to call the engine from
pages.
The RoboWindow function has four possible parameters:
n Server