function busUpLoadImg(postUrl,id) {
.......//省略部分不用修改
uploader.on('uploadSuccess', function(file) {
$('#' file.id).addClass('upload-state-done');
//验证是否上传上传
oSuccess = true;
});
//回调函数验证是否上传
var oSuccess = false;
return function(){
return oSuccess;
}
}
<input type="text" />
<input type="submit" onclick="subMit()" />
function subMit(){
fn1 = busUpLoadImg("postUrl",1);
fn2 = busUpLoadImg("postUrl",2);
if(!(fn1() && fn2())){
layer.msg("请上传图片",{time:1500});
return false;
}
}
更多专业前端知识,请上 【猿2048】www.mk2048.com