Am using the ajax file upload plugin from PHP Letter and am using jQuery 1.6.2.The files upload properly, but am unable to user the JSON data returned from the php script, when i check the javascript error consolse am i greeted with this error,

我使用了来自PHP的ajax文件上传插件,使用的是jQuery 1.6.2。文件上传的很好,但是无法使用从php脚本返回的JSON数据,当我检查javascript错误时,我得到了这个错误,

"Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'handleError'"

"未捕获的类型错误:对象函数(a,b){返回new .fn.init(a,b,h)}没有方法'handleError'"

in chrome and

在chrome和

"jQuery.handleError is not a function"

“jQuery。handleError不是一个函数"

in firefox.

在firefox中。

Does any one have a similar experience?

有没有人有类似的经历?

6 个解决方案

#1


46

It was when you are trying to use this with latest version of jQuery. handleError function is depreciated from library upper then V 1.5. I resolve it by just adding this function in my ajaxfileupload.js file.

当您尝试使用最新版本的jQuery时。handleError函数从库中折旧,然后是v1.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] );
    }
}

and it works fine for me. Also, if you try to use any ajaxSubmit() on same page it will wont work, so i use normal form submit with ajxfileupload. if any one can help in same way please let me know.

这对我来说没问题。另外,如果您尝试在同一页面上使用任何ajaxSubmit(),那么它将无法工作,所以我使用了正常的表单提交ajxfileupload。如果有人能以同样的方式帮助我,请告诉我。

更多相关文章

  1. php异常和错误处理
  2. PHP递归函数删除所有子节点导致stackoverflow
  3. 使用 PHP usort() 通过用户自定义的比较函数对数组进行排序
  4. [开心学php100天]第五天:string函数(上)
  5. curl获取网页内容出现乱码或为空的解决方案,另附curl_getinfo函数
  6. APMServ 在 Win7 下出现“APMServ-Apache 服务因 函数不正确。
  7. 本机PHP函数将授予我直接访问字符串部分而无需创建临时数组的权
  8. 从。net调用Magento API,并得到“位于XYZ的HTTP服务太忙”的错误
  9. 我得到了“致命错误:未捕获的SoapFault异常:[客户机]SoapClient:

随机推荐

  1. 《Hello First HTML 与 CSS 第2版》读书
  2. 构造方法的参数太多,如何解决?
  3. 被阿里云坑了一把
  4. 优雅地操作 List、Map
  5. 《Effective Java中文版 第2版》读书笔记
  6. 记一次应用线程被阻塞的问题排查
  7. 为什么搞公众号?它挣钱的秘密。
  8. 相似的故事总是在重复着
  9. 又升了一版「Java面试题小程序」
  10. 《Java8实战》读书笔记