Using JavaScript in Visualforce Pages
Using JavaScript in Visualforce
pages gives you access to a wide range of existing JavaScript functionality, such as JavaScript
libraries, and other ways to customize the functionality of your pages. Action tags, such as
<apex:actionFunction> and <apex:actionSupport>, support Ajax requests.
The best method for including JavaScript in a Visualforce page is placing the JavaScript in a static resource, then calling
it from there. For example,
You can then use the functions defined within that JavaScript file
within your page using <script> tags.
<apex:includeScript value="{!$Resource.MyJavascriptFile}"/>