views:

254

answers:

1

Hi Guys,

I am sending an AJAX request using POST over X-Domain for a widget we are producing for our website. The problem we are facing is that this is getting blocked.

My question is - for "modern browsers" [Chrome, Safari, FF, IE8] - it is my understanding that setting "Access-Control" headers

Access-Control-Allow-Origin: http://www.test.com
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: *
Access-Control-Max-Age: 1728000

Will allow these "POST" requests to work ? But for IE7 we need to implement some "custom" JSONP solution?

Am I correct in this ? Anyone ?

A: 

This works but not using the standard XmlHttpRequest object. For example in IE8 you should use the XDomainRequest object to send the request. For these scenarios, JSONP is actually easier to use and works cross-browser as implemented in jQuery.

Darin Dimitrov
The 2048 limit you are talking about applies only to request length in IE and not for the JSONP response which can be much larger (as answered in your previous question).
Darin Dimitrov