Activity › Forums › Salesforce® Discussions › What is a Javascript remoting for apex controllers in Salesforce? Explain its parts.
Tagged: AJAX in Salesforce, Apex Controllers, Callback, Javascript, Javascript Remoting, Visualforce Page
-
What is a Javascript remoting for apex controllers in Salesforce? Explain its parts.
Posted by madhulika shah on August 17, 2018 at 11:43 AMWhat is a Javascript remoting for apex controllers? Explain its parts.
Parul replied 7 years, 8 months ago 4 Members · 3 Replies -
3 Replies
-
Hi Madhulika
JavaScript remoting is a tool that front-end developers can use to make an AJAX request from a Visualforce page directly to an Apex controller. JavaScript remoting allows you to run asynchronous actions by decoupling the page from the controller and to perform tasks on the page without having to reload the entire page.
JavaScript remoting has three parts:
- The remote method invocation you add to the Visualforce page, written in JavaScript.
- The remote method definition in your Apex controller class. This method definition is written in Apex, but there are few differences from normal action methods.
- The response handler callback function you add to or include in your Visualforce page, written in JavaScript.
- [adinserter block='9']
-
Hi,
Use JavaScript remoting in Visualforce to call methods in Apex controllers from JavaScript. Create pages with complex, dynamic behavior that isn’t possible with the standard Visualforce AJAX components.
Features implemented using JavaScript remoting require three elements:The remote method invocation you add to the Visualforce page, written in JavaScript.
The remote method definition in your Apex controller class. This method definition is written in Apex, but there are some important differences from normal action methods.
The response handler callback function you add to or include in your Visualforce page, written in JavaScriptHope this helps.
-
hi
JavaScript remoting is a tool that front-end developers can use to make an AJAX request from a Visualforce page directly to an Apex controller. JavaScript remoting allows you to run asynchronous actions by decoupling the page from the controller and to perform tasks on the page without having to reload the entire page.
@RemoteAction
global static Account getAccount(String accountName)
{
account = [select id, name, phone, type, numberofemployees from Account where name = :accountName ];
return account;
}
}Thanks
Log In to reply.