乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      ajaxfileupload 異步上傳圖片返回?zé)o法進(jìn)入success,error

       瑤疏影 2016-02-16

      ajaxfileupload 異步上傳返回?zé)o法進(jìn)入error,控制臺打印報(bào)錯(cuò)如下:

      Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'handleError'

      主要是jquery版本的問題,需要版本是1.4.2之前的jquery版本(解決方法請參看位于JQuery文件夾下的文章:ajaxFileUpload 報(bào)這錯(cuò)jQuery.handleError is not a function

      后來通過想ajaxfileupload.js加入如下代碼解決

      Js代碼  收藏代碼
      1. handleError: function( s, xhr, status, e ) {  
      2.     // If a local callback was specified, fire it  
      3.     if ( s.error ) {  
      4.         s.error.call( s.context || window, xhr, status, e );  
      5.     }  
      6.     // Fire the global callback  
      7.     if ( s.global ) {  
      8.         (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );  
      9.     }  
      10. },   
       

       

      如果無法進(jìn)入success,看看是否是dataType 的類型返回不匹配

      我遇到的情況是dataType='json';

      后臺返回?cái)?shù)據(jù)代碼如下:

       

      Java代碼  收藏代碼
      1. Gson gson = new Gson();  
      2.   
      3. Map map = new HashMap();  
      4.             map.put("photoId", photo.getPhotoId());  
      5.             map.put("photopath", TargetCommentsPhotopathHelper.getPhotopath_x200(photo.getPath()));  
      6.               
      7.             String gsonStr = gson.toJson(map);  
      8.             PrintWriter out = response.getWriter();  
      9.             out.print(gsonStr);  
       

      這樣js會(huì)進(jìn)error,不進(jìn)success,主要是json返回的數(shù)據(jù)結(jié)構(gòu)不對,可以讓返回正確結(jié)構(gòu)或修改dataType='text';再自行解析


      以上來自:http://yangjayup./blog/1667094

        本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多