我在做一些Ajax调用时一直收到这个错误...

It may even be something to do with Geocoding but I really have no idea how to capture the error to display something useful to users... or even how to solve the problem as it seems to just be referencing some kind of pointer or something :S 0x2ef3

SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3.

An image might be more helpful than the error message:

enter image description here

Any ideas at all?

My code fires off 10 ajax calls in 1 second to be processed by geocoding server side.

错误时断时续地出现.有时我会得到地理编码的结果,有时我会得到那个错误.我会说我有10%的时间都能做到.它完全阻止了ajax调用在jQuery中触发我的错误处理程序.

推荐答案

This is the fix that worked for me. There is invalid mime or bad characterset being sent with your json data causing that errror. Add the charset like this to help it from getting confused:

$.ajax({
  url:url,
  type:"POST",
  data:data,
  contentType:"application/json; charset=utf-8",
  dataType:"json",
  success: function(){
  ...
  }
});

参考资料:

Jquery - How to make $.post() use contentType=application/json?

Could not complete the operation due to error c00ce56e

Jquery相关问答推荐

如何使用 JQuery 将详细信息中的项目包装在容器中?

ajax调用后Jquery事件不会触发

如何用 javascript/jquery 替换 url 参数?

Twitter Bootstrap 是否包含 jQuery?

在 jQuery 中,我想删除 div 中的所有 HTML

TypeScript 中是否有this的别名?

如何使用 jQuery 的 getJSON() 方法传递请求标头?

JSON字符串到JS对象

如何使用 JQuery 发布 JSON 数据?

使用 JQuery 更改 :before css Select 器的宽度属性

scrollIntoView 是否适用于所有浏览器?

使用 jQuery 刷新(重新加载)页面一次?

如何在实际图像下载时显示加载图像

数字键盘的keyCode值?

jQuery DataTables:延迟搜索直到输入 3 个字符或单击按钮

使用 jQuery 按字母顺序对选项元素进行排序

虽然未定义变量 - 等待

测试两个元素是否相同

如何在 Bootstrap 中创建切换按钮

如何在jQuery中 Select 最后一个子元素?