将Uploadify初始化代码延时加载,可解决Chrome崩溃。
setTimeout(initUploadify, 60);
function initUploadify() {
var $Uploadify = $("#uploadify");
var ext;
var id = 0;
var params;
$Uploadify.uploadify({
'swf': '/Scripts/uploadify/3.1/uploadify.swf',
'uploader': app.url,
'method': 'post',
'fileObjName': 'filedata',
'queueID': 'fileQueue',
'formData': { 'Code': 'ProductExcel', 'ASPSESSID': '' },
'auto': false,
'removeTimeout': 2, //文件队列上传完成1秒后删除
'multi': true,
'buttonClass': 'btn ',
'buttonCursor': 'hand',
'buttonText': "<i class='icon-upload'></i>选择附件",
queueSizeLimit: 10,
'fileSizeLimit': '300MB',
'fileTypeDesc': '常见格式',
'fileTypeExts': app.fileTypeExts,
width: 80,
height: 20,
'onUploadStart': function (file) {
$('#submit-btn').button('loading');
$Uploadify.uploadify("settings", 'formData', getParams());
},
'onUploadSuccess': function (file, data, response) {
},
'onSelect': function (file) {
},
'onCancel': function (file) {
}
});
}