alert(2)根本没有弹出呀!
<input id="cameraFile" type="file" title="" style="display: none;"
accept="image/*">
$("#cameraFile").trigger("click");
$('#cameraFile').on('change', function() {
alert(2)
var $this = this;
if ($this.files.length > 0) {// 确保有文件
var f = $this.files[0];
}
file.uploadImgBase64({
file : f,
progress : function(a) {
},
success : function(base64, $img) {
imgView($img, true, base64, $this);// 图片预览
},
error : function(msg) {
console.log("上传错误,错误原因为" + msg);
}
});
});
之前处理过,你试下这个链接描述