这是我面临的同一个问题参考
它在 chrome、firefox 中运行良好,但在 IE 中却不行……错误是“IE('异常抛出但未捕获'。第 95 行,字符 25')”
从参考资料中我知道错误在对象 writer.write
java代码:(它是否格式错误):任何人都可以调试这个错误
writer.write("{\"name\":\"" + item.getName()
+ "\",\"type\":\"" + item.getContentType()
+ "\",\"size\":\"" + item.getSize()
+ "\",\"filepath\":\"" + tp2 + "\"}");
js:
$(function () {
var initFileUpload = function (suffix) {
$('#file_upload').fileUploadUI({
namespace: 'file_upload_' + suffix,
fileInputFilter: '#file_' + suffix,
dropZone: $('#drop_zone_' + suffix),
uploadTable: $('#files_' + suffix),
downloadTable: $('.display-frame'),
buildUploadRow: function (files, index) {
return $('<tr><td>' + files[index].name
+ '<td class="file_upload_cancel">' + '<button class="ui-state-default ui-corner-all" title="Cancel">' + '<span class="ui-icon ui-icon-cancel">Cancel<\/span>' + '<\/button><\/td><\/tr>');
},
buildDownloadRow: function (file) {
// return $('<tr><td>' + file.name + file.filepath +'<\/td><\/tr>');
var path = '<div class="picthumb" id="pic" url="' + file.filepath + '" onclick="clickpick(this)"><div class="mainpic"><img src="';
path += file.filepath + '" class="uploader-thumb-img" style="width: 108px; height: 120px; top: 0px; left: 0px; "/></div></div>';
return $(path);
}
});
};
initFileUpload(1);
});
IE 显示的错误是 callback()
if (typeof callBack === func) {
try {
callBack();
} catch (e) {
// Fix endless exception loop:
$(this).stop();
throw e;
}
}