Redactor / Documentation / Callbacks

Overview

Overview #

Each callback receives Redactor object, so that you can always access any API methods from callback function using this, for example:

$('#redactor').redactor({
    callbacks: {
        init: function()
        {
            var html = this.code.get();
        }
    }
});

You can also set callbacks externally using jQuery method on for the element over which Redactor has been initialized.

$('#redactor').on('change.callback.redactor', function() {
   var html = this.code.get();
});
or from a plugin:
this.core.element().on('destroy.callback.redactor', function()
{
    // your code
});