html editor with file upload code example
Example: html editor with file upload
// Include the file upload plugin.
<script src="../js/plugins/file_upload.min.js"></script>
<script>
$(function() {
$('.selector')
.editable({
buttons: ['bold', 'italic', 'uploadFile', 'html'],
fileUploadParam: 'file_param',
fileUploadURL: '/upload_file',
fileUploadParams: {id: 'my_editor'}
})
.on('editable.fileError', function (e, editor, error) {
if (error.code == 0) { ... }
else if (error.code == 1) { ... }
else if (error.code == 2) { ... }
else if (error.code == 3) { ... }
else if (error.code == 4) { ... }
else if (error.code == 5) { ... }
else if (error.code == 6) { ... }
else if (error.code == 7) { ... }
})
});
</script>