国色天香久久精品国产一区,久久久久久久综合,亚洲成人二区,欧美日韩一区精品,久久97精品,久久综合中文,国产精品淫

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

jQuery.handleError is not a function錯誤

handlerError只在jQuery-1.4.2之前的版本中存在,jQuery-1.4.2之后的版本中都沒有這個函數(shù)了

所以jquery.form提交時有時候會提示該錯誤。


在jquery引用之后的某個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;
? ? }
});

肥西县| 益阳市| 甘德县| 瓮安县| 仁怀市| 济源市| 平远县| 安塞县| 康定县| 高陵县| 大名县| 阿坝县| 宁夏| 鹤峰县| 西华县| 普兰县| 安义县| 蚌埠市| 金山区| 南江县| 云林县| 灵丘县| 将乐县| 云阳县| 永安市| 浙江省| 安乡县| 罗江县| 江北区| 化德县| 那曲县| 涡阳县| 甘孜| 民和| 启东市| 奈曼旗| 焦作市| 吉安市| 德格县| 陆良县| 永胜县|