Examples

Catch Upload Errors

You need to return a value error to trigger error callback.


<script type="text/javascript">
$(function()
{
    $('#redactor').redactor({
        focus: true,
        imageUpload: '/your_image_upload_script/',
        imageUploadErrorCallback: function(json)
        {
            alert(json.error);
            alert(json.anothermessage);
        }
    });
});
</script>

The upload script returns JSON:

{
    "error": "Hi! It's error message",
    "anothermessage": "And another message."
}