Skip to content

Instantly share code, notes, and snippets.

@schuster-rainer
Created January 12, 2012 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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