jQuery JSON-RPC Server

This is a JSON-RPC server, specifically made to work with the Zend Framework JSON RPC Server. The Zend Framework JSON-RPC server is mildly off spec, and therefore this may not work with other JSON-RPC servers.

This JSON-RPC client polls the server for the available methods, and then creates an object with those methods that can then be used. Let's use the Zend Framework example of the Calculator class. Assume you just copy and pasted the example code from the link above to 'rpc.php'. You could write the following javascript code:

var client = jQuery.Zend.jsonrpc({url: 'rpc.php'});
alert(client.add(2,2));

And it'll just work. Pretty simple really.

NEW! MANY enhancements have been added. Namespace support, async requests, async reflections, and now the ability to cache or build SMDs so that you don't need the initial request to the server (and the server does not have to expose all methods available if that is not desired).

EVEN MORE NEW! Async calls have been made much more robust, and you can now have per-method callbacks. See the example index.html file that comes with the zip for more details.

My JSON-RPC server relies upon the json2.js file from JSON.org. Click the link below to download all the pertinent source with examples.

Download now!

Sitemap: Home | Projects | jQuery: JSON RPC | jQuery: Image Map | PHP/Zend: Tanabicom | PHP/Zend: TinyMVC | PHP/Zend: Cropper | Other: Linkspider | Android: Rooting |