TinyMCE:API/tinymce.util.JSONRequest/sendRPC

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Method: sendRPC (static)

Summary

Simple helper function to send a JSON-RPC request without the need to initialize an object. Consult the Wiki API documentation for more details on what you can pass to this function.

Syntax

<void> sendRPC(<Object> o)

Parameters

o
Call object where there are three field id, method and params this object should also contain callbacks etc.

Examples

tinymce.util.JSONRequest.sendRPC({
    url : '/somepage.php',
    method : 'someMethod',
    params : [1, 2, 'a'],
    success : function(result) {
        // JSON RPC result
        console.dir(result);
    },
    error : function(e, x) {
        // Handle error
        alert('Error!');
    }
});
Personal tools