实际上我正在尝试使用Uploadify脚本上传图像时刷新图像。图像上传成功,但onUploadSuccess java脚本功能未触发,尽管在我的query.uploadify.js文件中
onUploadSuccess // Triggered when a file is uploaded successfully
你能帮助我吗。谢谢
$(function () {
$("#file_upload").uploadify({
'swf': 'Resources/ImgUpload/uploadify.swf',
'uploader': 'VBHandler.ashx',
'cancelImg': 'Resources/ImgUpload/cancel.png',
'buttonText': 'Add Photos',
'fileDesc': 'Image Files',
'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'multi': true,
'auto': true,
'formData': {
"id": "<%=HfID.Value%>",
'onUploadSuccess': function (file, data, response) {
// Load the swfupload settings
alert('upload');
}
}
});
我使用的是版本Uploadify v3.2
答案 0 :(得分:2)
onUploadSuccess
不得在formData
。请尝试以下内容:
$(function () {
$("#file_upload").uploadify({
'swf': 'Resources/ImgUpload/uploadify.swf',
'uploader': 'VBHandler.ashx',
'cancelImg': 'Resources/ImgUpload/cancel.png',
'buttonText': 'Add Photos',
'fileDesc': 'Image Files',
'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'multi': true,
'auto': true,
'formData': {
"id": "<%=HfID.Value%>"
},
'onUploadSuccess': function (file, data, response) {
// Load the swfupload settings
alert('upload');
}
});