1. 程式人生 > >ajaxFileUpload 報這錯jQuery.handleError is not a function

ajaxFileUpload 報這錯jQuery.handleError is not a function

現在大家至少也在用jquery1.9以上的版本,ajaxfileupload的版本早就不更新了,大家可以下載看:地址這裡,它例子裡使用的Jquery是1.2的,好老呀。。。這個問題,我以前開發過程中遇過,網上說經測試(我是沒測試),是版本1.4.2之前的版本才有handlerError方法,之後就不存在了,(你存在,我深深的腦海裡。。。),為了能夠繼續使用ajaxfileupload上傳我們的附件,只好將程式碼拷進我們的專案中的ajaxfileupload.js檔案中,如下:
handleError: function( s, xhr, status, e )      {  
        // If a local callback was specified, fire it  
                if ( s.error ) {  
                    s.error.call( s.context || s, xhr, status, e );  
                }  
  
                // Fire the global callback  
                if ( s.global ) {  
                    (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );  
                }  
    }  

例子
$('#tjbut').click(function(){
		var uuid=$('.modal').attr('data-index');
		remark=$('#spmess').val(),
		 fileys = $('#fileys').get(0).files[0];
			
	            $.ajaxFileUpload
	            (
	                {
	                    url: './mqComet/mqMsg.do?method=msgCommit', //用於檔案上傳的伺服器端請求地址
	                    secureuri: false, //是否需要安全協議,一般設定為false
	                    fileElementId: 'fileys', //檔案上傳域的ID
	                    dataType: 'json', //返回值型別 一般設定為json
	                    data : {uuid:uuid,remark:remark},
	                    success: function (data, status)  //伺服器成功響應處理函式
	                    {
	                       if(data.isOk){
	                    	   $('.modal').hide();
	                       }
	                    },
	                    error: function (data, status, e)//伺服器響應失敗處理函式
	                    {
	                        alert(e);
	                    }
	                }
	            )
	            return false;
	        
	})


相關推薦

ajaxFileUpload jQuery.handleError is not a function

現在大家至少也在用jquery1.9以上的版本,ajaxfileupload的版本早就不更新了,大家可以下載看:地址這裡,它例子裡使用的Jquery是1.2的,好老呀。。。這個問題,我以前開發過程中遇過,網上說經測試(我是沒測試),是版本1.4.2之前的版本才有handl

引用(ajaxfileupload.js) ajaxfileupload.jsjQuery.handleError is not a function

在做ajaxFileUpload時,我也遇到這個問題,同時還有其它的問題,用了一下午的時間解決了: 問題1:如樓主所說,jQuery.handleError is not a function 原因是,經測試handlerError只在jquery-1.4.2之前的版本中存

ajaxfileupload.js的jQuery.handleError is not a function 解決辦法

handlerError只在jquery-1.4.2之前的版本中存在,jquery-1.4.2之後的版本中都沒有這個函數了。因此在jquery高階版本中將這個函式新增上 ,問題解決。 該js程式碼段可以加在jquer.js或者ajaxfileupload.js中。 ; (

ajaxfileupload.js jQuery.handleError is not a function

 在做ajaxFileUpload時,我也遇到這個問題,同時還有其它的問題,用了一下午的時間解決了: 問題1:jQuery.handleError is not a function 原因是,經測試handlerError只在jquery-1.4.2之前的版本中存在,j

ajaxFileUploadjQuery.handleError is not a function的解決方法

jQuery.handleError is not a function 報錯原因是: handlerError只在jquery-1.4.2之前的版本中存在,jquery-1.4.2之後的版本中都沒有

記js: {(intermediate value)} is not a function at HTMLDocument.

使用立即執行函式的時候,chrome報這個錯誤; const url = {   users: "xxx" }  //沒有;導致報錯 (function () {   //程式碼 })() js用func()方式呼叫函式,函式的定義有: 函式宣告,匿名函式,函式表示式; 立即執行函式

瀏覽器obj.attachEvent is not a function

書上講主流瀏覽器的事件模型分為IE事件模型和標準事件模型,那麼如何區分,IE事件模型中window物件提供了event屬性 儲存當前事件;標準事件模型中,事件物件是在事件觸發時生成,作為引數傳遞給事件處理程式,是區域性的。具體程式碼區分為 if (window.event) {obj.attac

videogular2 在ionic專案裡(rxjs_1.fromEvent is not a function)

這種是videogular2 跟ionic版本相容問題 換個videogular2版本試試 把原來版本去掉  自己手動安裝   npm install [email protected]

ajax返回String型別導致的flowplayerp.replace is not a function問題

今天用flowplayer拉流遇到了一個比較奇葩的問題,大致思路是js根據頁面的名稱採用ajax從後臺獲取號碼,然後用號碼建立任務輸出rtmp流,flowplayer進行播放,但是flowplayer初始化的時候報了個p.replace is not a function的

Vue.js搭建路由 router.map is not a function

錯誤: 出現問題原因:2.0已經沒有map這個方法了,只有1.0相容該方法。 解決方法: (1)方法1:使用命令npm install [email protected]相容1.0版本vu

antd的表格拖拽排序, :React.createContext is not a function

在使用 antd的表格拖拽排序功能時,  報錯: React.createContext is not a function 分析原因: 解決辦法: 1. 升級antd的版本          //下載固定版本 npm報錯,不指定版本OK。 2.  升

關於YII2框架-jQuery(…).activeform is not a function in 解決方法

在使用YII2框架過程中遇到過控制檯報出一個JS錯誤,jQuery(…).activeform is not a function,檢視原始碼看到這裡。 確定一下yii框架這個檔案有沒有載入 yii.activeForm.js 沒有的話,那麼問題原因就找到了。 解決方案有很多種

MongoDB建立管理員時報db.addUser is not a function

一開始是想用下面命令建立一個數據庫管理員的 db.addUser("paranoidyang","pwd") 結果卻報了下面的錯誤 後來谷歌了之後 ,才發現addUser這個方法在MongoD

jQuery提交表單 Uncaught TypeError: s[y] is not a function

使用jQuery提交表單的時候,頁面沒有反應,F12除錯發現點選提交按鈕,控制檯報錯 Uncaught TypeError: s[y] is not a function 問了百老師:發現可能是在form表單裡面 有一個input的id=“submit”,修改後,成功解決。

ajaxFileUpload$.ajaxFileUpload is not a function解決方法

報錯資訊 Uncaught TypeError:$.ajaxFileUpload is not a function 大意就是,ajaxFileUpload這個函式未定義 錯誤背景 我使用了ajaxFileUpload這個js來實現不借助form表單的不

使用jqueryreplace is not a function

1,情景描述:做專案的時候想把內容的某些字元給替換成另外一些字元 2,replace用法:replace() 方法用於在字串中用一些字元替換另一些字元,或替換一個與正則表示式匹配的子串。 3,我在頁

前端jQuery日曆控制元件 $("#datepicker").datepicker is not a function

使用日曆控制元件時,前端產生錯誤: $("#datepicker").datepicker is not a function 問題原因 前端在同一個頁面,jQuery引入了兩次。 解決方法 方法一、 去掉一個jQuery引用 方法二、 在前端頁面加入如下js程式碼 如果有兩個js庫同時呼叫了jQuery,可

Combobox:row[opts.textField].toLowerCase is not a function

light peer mem div clas erro sea error () 使用easyui框架加載combobox。 html頁面: <span class="search_item">   <span class="item_text">

js Uncaught TypeError: xxxx.each is not a function

each err typeerror span xxx list 報錯 pan 使用 在處理ajax返回的json數組時錯誤的使用了 list.each(function(){ }); 實際上當遍歷json數組是應該使用

_react3.default.createClass is not a function

component point create sla contents 新版本 body values origin 這個是因為react最新版本拋棄使用了createClass這個函數,這個也是為了配合ES6 。這種情況下會報錯 var Popover = Reac