2021精品综合久久久久,国产精品一国产精品,日韩国产在线,手机在线中文字幕乱码免费

首頁(yè) 服務(wù) 產(chǎn)品 文檔 關(guān)于

jQuery.handleError is not a function錯誤

handlerError只在jQuery-1.4.2之前的版本中存在,jQuery-1.4.2之后的版本中都沒(méi)有這個(gè)函數了

所以jquery.form提交時(shí)有時(shí)候會(huì )提示該錯誤。


在jquery引用之后的某個(gè)js中加入:

jQuery.extend({
? ? handleError: function (s, xhr, status, e) {
? ? ? ? if (s.error) {
? ? ? ? ? ? s.error.call(s.context || s, xhr, status, e);
? ? ? ? }
? ? ? ? if (s.global) {
? ? ? ? ? ? (s.context ? jQuery(s.context) : jQuery.event).trigger("ajaxError", [xhr, s, e]);
? ? ? ? }
? ? },
? ? httpData: function (xhr, type, s) {
? ? ? ? var ct = xhr.getResponseHeader("content-type"),
? ? ? ? ? ? xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
? ? ? ? ? ? data = xml ? xhr.responseXML : xhr.responseText;
? ? ? ? if (xml && data.documentElement.tagName == "parsererror")
? ? ? ? ? ? throw "parsererror";
? ? ? ? if (s && s.dataFilter)
? ? ? ? ? ? data = s.dataFilter(data, type);
? ? ? ? if (typeof data === "string") {
? ? ? ? ? ? if (type == "script")
? ? ? ? ? ? ? ? jQuery.globalEval(data);
? ? ? ? ? ? if (type == "json")
? ? ? ? ? ? ? ? data = window["eval"]("(" + data + ")");
? ? ? ? }
? ? ? ? return data;
? ? }
});

临西县| 新泰市| 沙田区| 潞城市| 确山县| 南宁市| 宝兴县| 襄汾县| 石棉县| 五河县| 台北县| 大石桥市| 洪洞县| 泸溪县| 牙克石市| 军事| 房山区| 基隆市| 甘泉县| 连云港市| 息烽县| 巧家县| 卓尼县| 当雄县| 张家口市| 抚州市| 德安县| 潞城市| 华宁县| 双城市| 满城县| 富顺县| 吴桥县| 江陵县| 青神县| 五常市| 砀山县| 麻城市| 炉霍县| 拜城县| 辛集市|