Skip to content

Instantly share code, notes, and snippets.

@swapnilshrikhande
Created September 19, 2018 11:21
Show Gist options
  • Save swapnilshrikhande/f3df4c4750aa8398309ff74fdaea9525 to your computer and use it in GitHub Desktop.
Save swapnilshrikhande/f3df4c4750aa8398309ff74fdaea9525 to your computer and use it in GitHub Desktop.
Simple Remoting Wrapper
var server = {
remoteActions : {
'search' : '{!$RemoteAction.PreChatFormController.searchRecord}'
},
config : {
buffer: false
, escape: false
, timeout: 120000
},
invoke : function(method,parameters,callback) {
this.connection_strategy(method,parameters,callback);
},
connection_strategy : function(remoteMethod,parameters,callback) {
try {
Visualforce.remoting.Manager.invokeAction(
this.remoteActions[remoteMethod]
, parameters
, callback
, this.config
);
} catch(exp){
throw exp;
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment