[jQuery] help please! I get status 0 and responsText is null
here is source code. In my javascript function I use jquery to make a ajax
call. myurl is a jsp in localhost which will output a xml. However i got
status 0(not 200). What happen?
$.ajax({
type:"POST",
url:myurl,
data: params,
complete:function(XMLHttpRequest,textStatus){
alert("respons status "+XMLHttpRequest.status+" content:
"+XMLHttpRequest.responseText+" header:
"+XMLHttpRequest.getAllResponseHeaders());
}
});
Here is the jsp:
<%response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", "no-cache");
String ajaxRs="<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
ajaxRs=ajaxRs+"<response>";
ajaxRs=ajaxRs+"<message>test!</message>";
ajaxRs=ajaxRs+"</response>";
System.out.println(ajaxRs);
response.getWriter().write(ajaxRs);
%>
Can anybody help me?
Thanks a lots!
--
View this message in context: http://www.nabble.com/help-please%21-I-get-status-0-and-responsText-is-null-tp22282492s27240p22282492.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.