导航

萌即是正义!时不时分享一些ACG活动记录与有趣代码的小站!

侧边栏
最新评论
广树管理员
2025-02-19 22:04
@老张博客:大佬呀,这第几次问这个问题了呀
老张博客
2025-02-19 21:18
我在想博主是不是一位女生呀
广树管理员
2025-02-19 20:46
@菲兹克斯喵:是呀,学生时代最喜欢的小说
菲兹克斯喵
2025-02-19 20:04
前段时间刚看完文学少女第九卷,后面没什么时间了 确实好看,快 20 年的小说了
广树管理员
2025-02-19 08:23
@某科学的贝壳:哈哈哈,确实属于有生之年了
正在攻略

logo_kai.jpg


PSN奖杯卡

PSN奖杯卡

赞助商广告

【jQuery】ajaxfileupload.js报错修正

作者:广树时间:2016-05-04 16:13:24分类:JavaScript

ajaxfileupload.js是一个好插件,能够兼容ie7、ie8这种老浏览器,但是因为长期没有更新导致无法支持高版本的jQuery库。

会报:jQuery.handleError is not a function

解决办法是增加一段修正脚本:


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;
	}
}); 


donate.png

1210 x 50(蓝底).png

cloudcone