Skip to content

Instantly share code, notes, and snippets.

@schuster-rainer
Created January 12, 2012 22:41
Show Gist options
  • Save schuster-rainer/1603606 to your computer and use it in GitHub Desktop.
Save schuster-rainer/1603606 to your computer and use it in GitHub Desktop.
jQuery json-rcp 2.0 using $.ajax
$.ajax({url: "to/my/service/endpoint.what",
type: "POST",
contentType: "application/json",
data: JSON.stringify({"jsonrpc": "2.0",
"method": "remote_func", "params": ["arg1","arg2"], "id": 1,
}),
dataType: "json",
success: function(response) {
alert(response.result);
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment