12.3.2 About Calling the JavaScript File from the Page Template
Reference a .js file in the page template.
               
Referencing a .js file in the page template makes all the JavaScript
            in that file accessible to the application. This is the most efficient approach since a
                .js file loads on the first page view of your application and is
            then cached by the browser. 
               
See Also:
Parent topic: Creating Custom Themes