//上传文件 function UploadFile(el) { var dataValue = $(el).attr("data-id"); var ele = dataValue.toLowerCase(); var f = document.getElementById(‘uploadFile_‘+ele).files[0] var src = window.URL.createObjectURL(f); document.getElementById(‘uploadPreview_‘ + ele).src = src; top.$("#uploadPreview_" + ele).attr("src", src); $("#upload_msg_" + ele).text("上传中,请稍候..."); //上传应用图标 $.ajaxFileUpload({ url: "../../Manage/Flow/UploadFile", secureuri: false, fileElementId: [‘uploadFile_‘ + ele], dataType: ‘json‘, success: function (data) { if ((data.message).indexOf(‘error‘) >= 0) { $("#upload_msg_" + ele).text(data.message); $("#upload_msg_" + ele).css("color", "red"); } else { $("#" + dataValue).val(data.message); $("#upload_msg_" + ele).text("上传成功!"); $("#upload_msg_" + ele).css("color", "#0a9a2f"); } } }); }