General Interface Builder allows you to add presentation logic to your application by writing custom JavaScript code. Presentation logic is any type of coding required to meet a user-specific requirement. For example, you can query a web service when a user clicks a button, or open a detail view in a list when a user selects a row.
There are several ways to add custom JavaScript to an application. The code is processed differently depending on how it's specified.
 | In General Interface Builder, fields where you can specify JavaScript code are distinguished visually with a light blue graph pattern background. |
The following table shows the locations in General Interface Builder where you can specify code and the impact of each method.
| Code Location |
What Code Does |
| Events Editor palette |
Each event can be associated with JavaScript statements. |
| Component Profile view in work area |
JavaScript statements can be executed either before or after a component is loaded in the application. |
| Dynamic properties file |
JavaScript statements execute in application (server) context to set a dynamic property value. |
| XML Mapping Utility |
JavaScript statements execute in context of the mapped XML message node being processed or created. |
| Project Settings dialog |
JavaScript statements execute during the onLoad event in application (server) context immediately after the root and body canvases are drawn on-screen. JavaScript statements execute during the onUnload event when the browser window is unloaded. |
| JavaScript file included in project |
A file containing JavaScript statements, method calls, constants, and so on can be included in a project. Any static execution is evaluated before components are loaded. |
| JavaScript Console |
Any JavaScript statements can be checked for errors before adding them to the application. |