Loading the JavaScript API
<script src="$distrib/insight-4.1.js"></script>
This import defines a global variable, insight, which is the top-level namespace object for the API.
insight.ready(function () { // Your view code here });
![]() |
Note In earlier versions, the insight API object was made available to you via an argument that you defined in your callback function, like this:
require('insight-api-1.2', function(insight) { // The API used to be available via local variable insight }); |
As in previous releases, the latest JavaScript API ships with several third-party libraries, including jQuery. Once you have imported insight-4.1.js, these libraries are available for use in your custom view without having to explicitly include them. Any other libraries that you need in addition to these should be included after insight-4.1.js. In previous releases, you may have used RequireJS to do this, but starting with the 2.0 API you include them using a simple <script src="..."> tag. See Bundled Third-Party Libraries for a full list.
![]() |
Note The path to the
Xpress Insight stylesheet has changed slightly too:
|
<html>
<head>
<link type="text/css" rel="stylesheet" href="$distrib/insight-4.04.1.css"/>
<script src="$distrib/insight-4.1.js"></script>
<script>
insight.ready(function () {
var view = insight.getView();
// etc...
});
</script>
</head>
<body>
etc...
</body>
</html>
© 2001-2019 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.