ajax 提示 type is not defind !

KB931125 2017-11-16 05:17:38


如上图,ajax 提示 type is not defind !,data is not defind,url is not defind,dataType is no defind
<script type="text/javascript">
// var map = new BMap.Map("allmap");
// map.centerAndZoom("广州市", 15);
$(document).ready(function(){
$.ajax({
type: "POST",
cache: false,
data: "",
url: "/DeviceMonitor/GetPersonInfo",
dataType: "json",
success: function (data) {
var stations=JSON.stringify(data);
alert(stations);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
//这个error函数调试时非常有用,如果解析不正确,将会弹出错误框
alert(XMLHttpRequest.responseText);
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus); // parser error;
}

});
// alert("跳到这啦");
})
</script>
...全文
359 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
孟子E章 2017-11-16
  • 打赏
  • 举报
回复
type、url、datatype不是变量,并没有值,他们只是json对象的key
KB931125 2017-11-16
  • 打赏
  • 举报
回复
不是断点的问题啊,我是说那些个type、url、datatype、之类的和里面的变量stations都提示is not defind呀,数据我可以取出打印出来啊
Hello World, 2017-11-16
  • 打赏
  • 举报
回复
断点在success里面,超出了作用域,那些变量都是不可访问的

87,997

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧