AJAX XML-RPC Client

Provides a simple JavaScript XML-RPC client that communicates with XMLHttpRequest (often called AJAX). Both the arguments passed and the return variable are processed as JavaScript objects, simplifying transformations by the user.
Download: xmlrpc.js

API

var xmlrpc = function(
    server,     /* URL of the server. */
    method,     /* Name of the RPC method. */
    params,     /* Array of parameters as JS Objects. */
    callback,   /* Callback function, passed return variable as a JS Obj. */
    callErr,    /* Callback error function, passed error as string. */
    callFinal   /* Callback finalise function, always called. */
)

Example

Call an RPC function named open, passing it a string “index.wix”.
xmlrpc("http://www.myserver.com/RPC", "open", [ "index.wix" ], function(ret) {
    alert("loaded, got " + ret);
}, function(err) {
    alert("error occurred: " + err);
}, function() {
    alert("finished");
});

alert("loading");
<analytics.inc>