json - JQuery, XmlHttpRequest and Status Code 0 -


I am currently doing some cross-domain JavaScript using JSONP, and ASP.NET MVC.

The special controller action answers only one post request, it is according to the design.

In IE8, I can see (through Fiddler2) that the response is correct, and an HTTP 200 response is returning to JSONP JavaScript.

In Firefox, Safari and Chrome, the response is still returning with the appropriate HTTP 200 code and JSONP content, the only difference is that the XmlHttpRequest object setting being used by JQuery is 0 Status code and response to blank.

Basically, I thought this was due to the HTTP preflighting (HTTP access control), leaving an additional HTTP request (an option to send a content type other than custom headers or text / plain) With) cause of action. I can see in Fiddler2 that the option is responding to HTTP 404 with an HTTP request.

The web server is IIS7 (but the production web server will be the IIS6 box). In IIS7, I can see that the standard options are listed in the VERbHandler handler, but I am not sure whether this is actually doing anything (in fact, I can not find any documents about OPTIONSVerbHandler anywhere).

To get this round, I modified the JQuery Library to not set a custom header, and to convert content / type to text / plain instead of App / JSON and Firefox has options Start bypassing the option and only plain post. >

The problem is still in an empty response (according to the XmlHttpRequest object), although Fiddler2 shows that a successful HTTP 200 reaction is being backed with content.

Any help?

Exit, you can not use cross-domain calls with JQuery via post (which It makes sense, because it renders a script to call). Switching to switch to solve this issue, and now everything is returning properly.

Through the jQuery source it was a walk to extract that, but thanks for the reply.

Matt


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -