免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2527 | 回复: 0
打印 上一主题 下一主题

[Ajax] 求助Ajax错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-01-15 22:17 |只看该作者 |倒序浏览
这段代码有什么错误呀?
  1.                 $.ajax({
  2.                         type: "POST",
  3.                         contentType: "application/json",
  4.                         url: "http://www.baidu.com/",
  5.                         data: {id: '0'},
  6.                         dataType: "json",
  7.                         timeout: 3000,
  8.                         success: function(result){
  9.                                 //return array
  10.                                 alert("success");
  11.                                 clientArray = result.d[0];
  12.                                 statusArray = result.d[1];
  13.                                
  14.                                 if(typeof(clientArray) == "undefined" || typeof(statusArray) == "undefined"){
  15.                                         alert("No data got");
  16.                                         return;
  17.                                 }
  18.                                
  19.                                 // createChart();
  20.                         },
  21.                         error: function(XMLHttpRequest, textStatus, errorThrown){
  22.                                 alert(XMLHttpRequest.status);
  23.                 alert(XMLHttpRequest.responseText);
  24.                                 alert(XMLHttpRequest.responseXML);
  25.                 alert(textStatus);
  26.                                 alert(err);
  27.                         },
  28.                         complete: function(XMLHttpRequest, textStatus) {
  29.                         this; // 调用本次AJAX请求时传递的options参数
  30.                                 alert(XMLHttpRequest);
  31.             }
  32.                 }
  33.                 );
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP