function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Luis Antonio Aguilar RosalesLuis Antonio Aguilar Rosales 

What is the difference between these two ways of call a remote method

Hi Guys,   I hope you can help me, I only want to know what is the diference beween invoking a remoted method using this  statment 

RemoteClass.remoteActionMethod(str,function(result, event){ if (event.status) { alert(result); } } );

versus this one 

 Visualforce.remoting.Manager.invokeAction(
            '{!$RemoteAction.RemoteClass.remoteActionMethod}',  ...... 

 
Alain CabonAlain Cabon
They are equivalent.

RemoteClass.remoteActionMethod(str,function(result, event) is just "simpler" (without using the remoting manager explicitely).

The documentation almost always uses the Visualforce.remoting.Manager.invokeAction but that is not mandatory.

Behind the scene, there is always the Visualforce.remoting.Manager that is used.

https://salesforce.stackexchange.com/questions/161855/what-happens-behind-the-scenes-of-salesforce-remoting/161867

There is another property for Visualforce.remoting : Visualforce.remoting.timeout = 120000; // Set timeout at page level