Hello World!
<installdir>\examples\insight\quick_start.zip
<installdir>\examples\insight\developer_guide\javascript_api\hello_world_example\application.bim

Hello World Folder Structure
<html-view title="Hello World Example" default="true" path="hello-world.html"/>
The Hello World Example view is specified as the default view when one or more scenarios are selected. The view will be available in the Xpress Insight web client as a tab when the app is selected.
insight.ready(function () { var view = insight.getView(); view.withFirstScenario() .bindAutoText('#hellomessage'); view.start(); });
![]() |
Note The JavaScript API is an HTML file and a JavaScript file.
|
Notice that the JavaScript code is wrapped up in a call to insight.ready. This ensures that your code will not be executed until the Xpress Insight API is fully initialized.
<!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initialscale=1.0"> <link type="text/css" rel="stylesheet" href="$distrib/insight-4.7.css"/> <script src="$distrib/insight-4.7.js"></script> <script src="js/hello-world.js"></script> </head> <body> <p class="view-initializing">Initializing...</p> <div class="view-initialized" style="display: none"> <h1>Hello, world! AutoText Example</h1> <!-- start custom content --> <h1 id="hellomessage" data-entity="MyScalar"></h1> <!-- end custom content --> </div> </body> </html>
The preceding code shows all of the HTML code required to include and initialize JavaScript API 4.7. It provides all the data, state, and view management needed to develop Xpress Insight applications.
The following sections describe these codes examples in more detail.
© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.