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.

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: Pho Cart | PHP/Zend: Tanabicom | PHP/Zend: TinyMVC | PHP/Zend: Cropper | Other: Linkspider |