类似
var uploadbutton = K.uploadbutton({
button: K('#uploadButton')[0],
fieldName: 'imgFile',
url: '/Scripts/kindeditor/asp.net/upload_json.ashx?dir=image',
afterUpload: function (data) {
if (data.error === 0) {
var url = K.formatUrl(data.url, 'absolute');
K(".logurl").val(url);
} else {
alert(data.message);
}
},
afterError: function (str) {
alert('自定义错误信息: ' + str);
}
});
uploadbutton.fileBox.change(function (e) {
uploadbutton.submit();
});
var bgurl = K.uploadbutton({
button: K('#uploadBgUrl')[0],
fieldName: 'imgFile',
url: '/Scripts/kindeditor/asp.net/upload_json.ashx?dir=image',
afterUpload: function (data) {
if (data.error === 0) {
var url = K.formatUrl(data.url, 'absolute');
K('.bgurl').val(url);
} else {
alert(data.message);
}
},
afterError: function (str) {
alert('自定义错误信息: ' + str);
}
});
bgurl.fileBox.change(function (e) {
bgurl.submit();
});
多个uploadbutton时(超过3个),有些按钮获取不到返回值,进不去afterupload,ie8浏览器中是这样,在google中没有问题。是我用的方法不对还是什么问题呢,有没有别的好的方法?