I have a controller with the below (sanitized) methods:
@remoteAction
global static String getParam1(String someInput1){
String param1 = someInput1;
return param1;
}
@remoteAction
global static String getParam2(String someInput2){
String param2 = someInput2;
return param2;
}
And a VF page with the following javascript:
<script>
//vf remoting
Visualforce.remoting.Manager.invokeAction("{!$RemoteAction.controller.getParam1}", aninputhere, function(result,event){
var jsParam1 = result;});
//calling method directly
controller.getParam2(aninputhere,function(result,event){
var jsParam2 = result;});
</script>
While I have done this inconsistently by accidental both work fine in all contexts that they are used...is there any benefit/reason I should use the vf remoting approach in javascript over calling the controller directly?