TinyMCE:API/tinymce.util.JSONRequest
From Moxiecode Documentation Wiki
Contents |
[edit]
Class: tinymce.util.JSONRequest
This class enables you to use JSON-RPC to call backend methods.
[edit]
Constructor
- JSONRequest
- Constructs a new JSONRequest instance.
[edit]
Methods
- send
- Sends a JSON-RPC call.
- sendRPC
- Simple helper function to send a JSON-RPC request without the need to initialize an object.
[edit]
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);
}
});
