我正在使用cropperjs 裁剪图像。我的裁剪功能是这样的:
function GestionCropEventPhoto(CtrlID) {
$('#' + CtrlID + '_event_img').cropper({
aspectRatio: 1,
autoCropArea: 1,
crop: function (e) {
var json = [
'{"x":' + e.x,
'"y":' + e.y,
'"height":' + e.height,
'"width":' + e.width,
'"rotate":' + e.rotate + '}'
].join();
}
});
var Values = {}
Values["eventid"] = $('#' + CtrlID + '_PEventID_HF').val();
$('#' + CtrlID + '_fileupload', this.el).fileupload({
url: gestionPath + "/App_Dynamic/WS_Gestion.asmx/UploadedEventPhoto",
autoUpload: true,
type: 'POST',
dataType: 'json',
submit: function (e, data) {
data.formData = Values;
},
start: function (e) {
$('#' + CtrlID + '_fileupload_P').css('width', '0%');
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#' + CtrlID + '_fileupload_P').css('width', progress + '%');
},
done: function (e, data) {
if (data.jqXHR.responseText || data.result) {
var JSONjQueryObject = (data.jqXHR.responseText) ? jQuery.parseJSON(data.jqXHR.responseText) : data.result;
if (JSONjQueryObject.Value._IsError) {
ShowErrorMessage('DONE:' + JSONjQueryObject.Value._errorMSG);
} else {
$('#' + CtrlID + '_event_img').cropper.('replace', JSONjQueryObject.Value._name)
}
}
},
fail: function (e, data) {
ShowErrorMessage('Error: ' + data.jqXHR.responseText);
}
});
现在,我相信我正在使用cropper('replace', ...) 的“完成”部分中的最后一个“其他”是造成问题的原因。你们能帮帮我吗?