2012-07-25 57 views
0

这是我面临的referencequery.Fileupload的UI错误引发的异常,但没有抓到

同样的问题,它在镀铬细,火狐但不是在IE浏览器...的错误是“IE('抛出异常并没有抓到)”

从参考我才知道错误是在对象writer.write

Java代码” 95号线,25' 字符:(是否畸形):任何人都可以调试在此错误

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是示出的回调()

if (typeof callBack === func) { 
     try { 
          callBack(); 
      } catch (e) { 
          // Fix endless exception loop: 
          $(this).stop(); 
          throw e; 
         } 
      } 
+0

我发现错误是defintely w对象编写者通过对其进行硬编码而出现故障 – 2012-07-25 09:44:29

回答

0

问题是由于某种原因item.getname是铬 和c filename.jpg作家对象: /images/filename.jpg所以我删除item.getname这是不需要的

writer.write("{\",\"type\":\"" + item.getContentType() + "\",\"size\":\"" + item.getSize() + "\",\"filepath\":\"" + tp2 + "\"}");