TinyMCE:API/tinymce.util.JSONRequest

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Class: tinymce.util.JSONRequest

This class enables you to use JSON-RPC to call backend methods.

Constructor

JSONRequest
Constructs a new JSONRequest instance.

Methods

send
Sends a JSON-RPC call.
sendRPC
Simple helper function to send a JSON-RPC request without the need to initialize an object.

Examples

var json = new tinymce.util.JSONRequest({
    url : 'somebackend.php'
});

// Send RPC call 1
json.send({
    method : 'someMethod1',
    params : ['a', 'b'],
    success : function(result) {
        console.dir(result);
    }
});

// Send RPC call 2
json.send({
    method : 'someMethod2',
    params : ['a', 'b'],
    success : function(result) {
        console.dir(result);
    }
});
Personal tools