Skip to content

Instantly share code, notes, and snippets.

@mailtoharshit
Created August 7, 2012 22:42
Show Gist options
  • Save mailtoharshit/3290136 to your computer and use it in GitHub Desktop.
Save mailtoharshit/3290136 to your computer and use it in GitHub Desktop.
apex:page controller="RemotingObjectsController">
<script>
/* Declare Javascript Function
function Account(){
this.Id = null;
this.Name = null;
}
var acc1 = new Account();
acc1.Name = 'Texas';
var acc2 = new Account();
acc2.Name = 'Austin';
var accounts = new Array(acc1, acc2);
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.RemotingObjectsController.addAccounts}',
accounts
function(result, event) {
console.log(result);
});
</script>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment