Ajax响应:[readyState的:0,responseText的:"",状态:0,状态文本:"错误"] [英] Ajax Response: [readyState: 0, responseText: "", status: 0, statusText: "error"]
本文介绍了Ajax响应:[readyState的:0,responseText的:"",状态:0,状态文本:"错误"]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的Ajax调用导致错误。下面是我能得到的错误回调的信息:
的readyState:0
responseText的:
状态:0
状态文本:错误
这是什么意思?我究竟做错了什么?
下面是我的ajax调用:
VAR ajaxurl ='../mainDir/server.cfc?param1=123¶m2=234&method=updateMyInfo';
$阿贾克斯({
网址:ajaxurl,
数据类型:文本,
成功:功能(数据){
警报(成功);
},
错误:函数(XHR,ajaxOptions,thrownError){
警报(错误);
}
});
解决方案
现在的问题是,你是不部署到服务器上运行的页面。因此,Ajax请求被作为跨域调用。
My ajax call is resulting in error. Here is the info that I could get in error callback:
readyState: 0
responseText: ""
status: 0
statusText: "error"
What does that mean? What am I doing wrong?
Here is my ajax call:
var ajaxurl = '../mainDir/server.cfc?param1=123¶m2=234&method=updateMyInfo';
$.ajax({
url: ajaxurl,
dataType:"text",
success: function( data ) {
alert('success');
},
error: function( xhr, ajaxOptions, thrownError ) {
alert('ERROR');
}
});
解决方案
The Problem is that you are running the page without deploying into server. So ajax request is taken as Cross domain call.
这篇关于Ajax响应:[readyState的:0,responseText的:"",状态:0,状态文本:"错误"]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文