// base sEditor('.editor') // upload image to server sEditor('.editor', {file: { // fileInfo as File Object // callback(remote_image_url) for rich editor image callback uploader: function(fileInfo, callback) { var fReader = new FileReader(); fReader.onload = function(e) { $.post('/uploader', {file: e.target.result}, success: function(data){ callback(data.url); }) }; fReader.readAsDataURL(fileInfo); } }})