我正在使用PHP Letter的ajax文件上传插件,并使用jQuery 1.6.2.文件正确上传,但我无法使用从php脚本返回的JSON数据,当我检查javascript错误时,我遇到了这个错误,
"未捕获的TypeError:对象函数(a,b){return new e.fn.init(a,b,h)}没有方法'handleError'"
在铬和
"jQuery.handleError不是函数"
在Firefox中.
有没有人有类似的经历?
Gov*_*tla 48
当你尝试使用最新版本的jQuery时.handleError函数从库上限到V 1.5折旧.我通过在我的ajaxfileupload.js文件中添加此函数来解决它.
handleError: function( s, xhr, status, e ) {
// If a local callback was specified, fire it
if ( s.error ) {
s.error.call( s.context || window, xhr, status, e );
}
// Fire the global callback
if ( s.global ) {
(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
}
}
Run Code Online (Sandbox Code Playgroud)
它对我来说很好.此外,如果您尝试在同一页面上使用任何ajaxSubmit()它将无法工作,所以我使用正常的表单提交与ajxfileupload.如果有人能以同样的方式提供帮助,请告诉我.