Initializing help system before first use

# The View

The first interesting line of code in the JavaScript file `hello-world.js` fetches a reference to the current view.

    var view = insight.getView();

This object is a representation of a single view in the client (specifically, the tab that you clicked on in the web client).

Each view has its own HTML file and typically an accompanying JavaScript file as well. Each view also has a reference in the companion file, and together these elements make up the view that is displayed when you click on the corresponding tab in the web client.

This view instance that is returned from the `getView()` function call has a number of methods and properties that you can call to interact with the view. However, the focus here will be on `withFirstScenario`.

Note: The JavaScript reference for the view class lists the other methods and options available.

    view.withFirstScenario()

This code specifies that we are only interested in the first scenario that has been selected by the user. The function responds by returning a `ScenarioObserver` object that will handle all our interactions with the view. There are two other similar functions we can call, specifically `withScenarios` and `withAllScenarios`, but for now the focus will be on the first scenario. You will learn how and when to use the other function calls with multi-scenario views later in this chapter.

Parent Topic Hello World!

© 2001-2026 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.