Loading the JavaScript API
<script src="$distrib/insight-4.5.js"></script>
This import defines a global variable, insight, which is the top-level namespace object for the API.
insight.ready
:
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:
|
insight.ready
function, to avoid the global insight variable being shadowed by a local argument variable with the same name. You may find that the old argument had a different name, such as Insight, in which case, any references to it will need to be renamed.
As in previous releases, the latest JavaScript API ships with several third-party libraries, including jQuery. Once you have imported insight-4.5.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.5.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.
![]() |
Note: The path to the
Xpress Insight stylesheet has changed slightly too:
|
<html>
<head>
<link type="text/css" rel="stylesheet" href="$distrib/insight-4.5.css"/>
<script src="$distrib/insight-4.7.js"></script>
<script>
insight.ready(function () {
var view = insight.getView();
// etc...
});
</script>
</head>
<body>
etc...
</body>
</html>
© 2001-2021 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.