Newer Version Available
Sample Visualforce Page Using the AJAX Toolkit
This example demonstrates using the AJAX Toolkit in a Visualforce page.
To add JavaScript to a Visualforce page, use this procedure:
- Create the Visualforce page. For more information, see the Visualforce Developer's Guide.
- Cut and paste the following sample code into your Visualforce page.
The JavaScript code queries your organization and returns every account ID, account name, and industry type, if any:
After you created and navigated to the Visualforce page, you see text similar to this image:
