Created
February 5, 2014 22:55
-
-
Save stefanneculai/8835056 to your computer and use it in GitHub Desktop.
Image upload using Froala WYSIWYG editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$('.selector').editable({ | |
// Set the image upload parameter. | |
imageUploadParam: 'file_param', | |
// Set the image upload URL. | |
imageUploadURL: '/upload_path', | |
// CORS. Only if needed. | |
crossDomain: false, | |
// Set the image error callback. | |
imageErrorCallback: function (data) { | |
// Bad link. | |
if (data.errorCode == 1) { | |
console.log ('bad link') | |
} | |
// No link in upload response. | |
else if (data.errorCode == 2) { | |
console.log ('bad response') | |
} | |
// Error during file upload. | |
else if (data.errorCode == 3) { | |
console.log ('upload error') | |
} | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Managed to create an upload with java for froala?