firebug - XMLHttpRequest returns status of 0 in Firefox 3.6.10 and up from cross origin requests -
i developing application makes cross origin ajax request http server written using netty.
an example of type of javascript code being executed below.
$.ajax({ type:"get", url:"http://localhost:5000/someresource", data: { id1: "1", id2: "2" }, success: function(status, textstatus, xhr) { alert("success") }, error: function(status, textstatus, xhr) { alert("error") } });
the problem seeing on firefox (3.6.10 , 4.0 beta) status of xmlhttprequest 0, regardless of status of response. in firebug can see server returning correct status request, not being pushed through xmlhttprequest object.
below request , response headers being sent
response headers content-type text/plain; charset=utf-8 content-length 0 access-control-allow-orig... http://localhost:9000 cache-control no-cache connection keep-alive date thu, 07 oct 2010 07:52:08 gmt request headers host localhost:5000 user-agent mozilla/5.0.... accept */* accept-language en-gb,en;q=0.5 accept-encoding gzip,deflate accept-charset iso-8859-1,utf-8;q=0.7,*;q=0.7 keep-alive 115 connection keep-alive content-type application/x-www-form-urlencoded referer http://localhost:9000/test origin http://localhost:9000
i have tried executing code in chrome, opera , safari , work fine. doing or bug in firefox?
thanks in advance.
i have seen problem in both firefox 3.6+ , chrome. reason found debugging site on localhost server. both of these return appropriate response codes when ran remote url. both return different status codes localhost.
Comments
Post a Comment