我正在尝试使用cropper js从url裁剪图像
但它返回“Access-Control-Allow-Origin”错误
var $img = $('<img/>');
$img.attr({src: src}).load(function () {
$container.html($img);
$container.css({maxWidth: 100});
$container.css({maxHeight: 100});
$img.cropper({
cropBoxResizable: false,
aspectRatio: 100 / 100,
minCropBoxWidth: 100,
minCropBoxHeight: 100,
dragMode: 'move',
fillColor: '#fff',
crop: function (e) {
$('.coords').val(e.x + ',' + e.y + ',' + e.width + ',' + e.height);
}
});
});