What is Ajax Call ?
After the initial page load, the client(browser) can interact with server asynchronously without page reload/redirection. This method is called AJAX technique. Its quite popular in modern web practices.Why is it necessary ?
To build single page applications(SPA), we need to handle the interaction with server( POST calls) asynchronously & optionally update the portion of screen without full page reload. In order to achieve that AJAX calls are required.What are the ways to achieve it ?
There are 5 ways one can use Ajax call in Visualforce,- Remote Objects
- Action Functions
- Remote Methods
- SOAP API
- REST API
Where is code for each one ?
I have given example for each type, achieving the same result, i.e all the examples fetches 10 Opportunity records & display them in a div tag asynchronously.
Remote Objects
Action Functions
Remote Methods
SOAP API
REST API
A Class used for these examples,
No comments:
Post a Comment
Thanks for reading my blog !