15.1.7.7 Providing App-Wide Helper Functions
Put JavaScript helper functions used on multiple pages in an application-wide library.
If you foresee setting a dynamic dialog title in many pages in your app, then it's a great candidate to include in an application-wide helper function library. For maintenance purposes, this idea beats the alternative of copying and pasting the same code over and over. In each usage, only the title text would be different. Creating an application-wide JavaScript function library involves two steps:
- Adding a Static Application File to contain the helper code
- Referencing the file in your application's User Interface JavaScript File URLs list.
- Adding Static Application JavaScript File
Use a Static Application File shared component to include files of any kind with your app. - Including Helper Functions in All Pages
Once you add JavaScript file to Static Application Files, cite the script's reference URL in application settings to load it on all pages.
Parent topic: Exploring Additional Page Features