$.ajax jsonp parsererror
发布时间:2020-12-16 03:25:18 所属栏目:百科 来源:网络整理
导读:场景重现 通过 $.ajax() 发起的跨越请求代码如下: $.ajax({ dataType: "JSONP",type: "GET",url: "http://...",data: {},success: function(data,textStatus){ // 这里什么都没处理,写了也没反应. },error: function(xhr,textStatus,ex){ console.log(textSt
场景重现通过 $.ajax({ dataType: "JSONP",type: "GET",url: "http://...",data: {},success: function(data,textStatus){ // 这里什么都没处理,写了也没反应. },error: function(xhr,textStatus,ex){ console.log(textStatus); console.log(ex); } }); 发起 ajax 跨域请求后... // Firefox 控制台下总是输出 SyntaxError: missing ; before statement 咋一看 parsererror Error: jQuery111209138057178219225_1496905174485 was not called 堆栈跟踪: error@http://localhost:5903/js/jquery/jquery-1.11.2.min.js:2:1809 b.converters["script json"]@http://localhost:5903/js/jquery/jquery-1.11.2.min.js:4:27729 Pc@http://localhost:5903//js/jquery/jquery-1.11.2.min.js:4:18329 x@http://localhost:5903/js/jquery/jquery-1.11.2.min.js:4:21743 send/b.onreadystatechange@http://localhost:5903/js/jquery/jquery-1.11.2.min.js:4:27017 错误原因初步怀疑是接口提供方没有处理跨域请求,没有把处理结果包含到 解决办法
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |