作者:天人景观2010 | 来源:互联网 | 2023-05-17 09:19
Ihaveaajaxrequest,whereihavecodeforbothsuccessandfailure我有一个ajax请求,其中包含成功和失败的代码succe
I have a ajax request, where i have code for both success and failure
我有一个ajax请求,其中包含成功和失败的代码
success: function(my_response) {
},
failure: function(my_response) {
}
I am using Perl CGI in the server to handle the Ajax request, it prints below string when there is a failure
我正在服务器中使用Perl CGI处理Ajax请求,当出现故障时,它将打印到字符串下面
print "Content-type: text/plain\n\n";
print "{success: false, errors: {response: 'Query Failed -- Please check the syntax'}}";
exit
In the firebug, i can see the above response. But, my browser is always executing the code in success. Is there anything wrong in the way i am handling the ajax request?
在firebug中,我可以看到上面的响应。但是,我的浏览器总是成功地执行代码。我处理ajax请求的方式有问题吗?
1 个解决方案