Accessing the Actuate JavaScript API
To use the Actuate JavaScript API from a web page, add a script tag that loads the Actuate JavaScript API class libraries from an Actuate application.
Start with a web page that contains standard HTML elements, as shown in the following code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<div id="viewer1">
<script type="text/javascript" language="JavaScript"
src="http://127.0.0.1:8700/iportal/jsapi"></script>
<script type="text/javascript" language="JavaScript">
… <!--functionality goes here-->
</script>
</div>
</body>
</html>
The <script> element nested in the <div> element imports the Actuate JavaScript API libraries into the web page’s context. For example:
<script type="text/javascript"
src="http://127.0.0.1:8700/iportal/jsapi">
</script>
where
*127.0.0.1:8700 is the host name and TCP port for an available Actuate application host.
*/iportal is the context root for the Actuate web service.
*/jsapi is the default location of the Actuate JavaScript API libraries.
Use additional script tags to call JavaScript functions for the page. Use the actuate.load( ) function to enable the components of the Actuate JavaScript API.
The scripts in this section are encapsulated in <div> tags for portability. Encapsulated Actuate JavaScript API functions can be used in any web page.
About the DOCTYPE tag
To render the page in standards compliance mode, specify strict.dtd in the DOCTYPE tag at the top of the page. Standards compliance mode makes the page layout and behaviors significantly more consistent. Pages without this definition render inconsistently.
About UTF8 character encoding
Use a <meta> tag to direct the browser to use UTF8 encoding for rendering and sending data. UTF8 encoding prevents the loss of data when using internationalized strings.