forked from michilu/jquery.jsonrpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Yet another JSON-RPC plugin. JSON-RPC 2.0 and JSON-RPC over WebSocket Support
License
Ardavans/jquery.jsonrpc
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
jQuery JSON-RPC Plugin A JSON-RPC 2.0 implementation for jQuery. JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. Read more in the <http://groups.google.com/group/json-rpc/web/json-rpc-2-0> Usage: $.jsonrpc(url, data [, callbacks] [, debug]); where data = {method:'methodname', params:['positional', 'parameters']} or data = {method:'complexmethod', params:{named:'parameters', works:'too!'}} and callbacks = {success: successFunc, fault: faultFunc, error: errorFunc} Setting no callback produces a JSON-RPC Notification. 'data' accepts 'timeout' keyword too, who sets the $.ajax request timeout. Setting 'debug' to true prints responses to Firebug's console.info Examples: // A RPC call with named parameters $.jsonrpc('/rpc', { method : 'createUser', params : {name : 'John Smith', userId : '1000'} }, { success : doSomething(response), fault : handleFault(response, errordata), error : handleError(request, status, error); }); // A Notification $.jsonrpc('/rpc', { method : 'notify', params : {action : 'logout', userId : '1000'} }); // A Notification using console to debug and with timeout set $.jsonrpc('/rpc', { method : 'notify', params : {action : 'logout', userId : '1000'}, debug : true, timeout : 500, });
About
Yet another JSON-RPC plugin. JSON-RPC 2.0 and JSON-RPC over WebSocket Support
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published