国色天香久久精品国产一区,久久久久久久综合,亚洲成人二区,欧美日韩一区精品,久久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;
? ? }
});

西平县| 井冈山市| 辽宁省| 西丰县| 德钦县| 密云县| 科技| 新竹市| 毕节市| 黄浦区| 襄垣县| 嘉义县| 东宁县| 咸丰县| 景谷| 海兴县| 海丰县| 乌鲁木齐县| 长宁县| 楚雄市| 丽江市| 辽阳市| 望谟县| 泌阳县| 法库县| 文成县| 徐州市| 阿拉尔市| 拉孜县| 进贤县| 沙雅县| 台安县| 宜阳县| 巴里| 嘉禾县| 若羌县| 浙江省| 乾安县| 柏乡县| 许昌县| 清新县|