0

I have ajax cross-domain request.

 $.ajax({
        type: "GET",
        url: url,
        success: function(xml) {
            $('.post-msg').append(processXml(xml, config));
        },
        error: function(jqXhr, textStatus, errorThrown) {
            var errorMsg = "Request on url: " + url + " failed: " + textStatus + " error:" + errorThrown;
            alert(errorMsg);
        }
    });

And i need "convert" this using technology Postmessage(https://github.com/daepark/postmessage). Earlier I did not worked with such things.

Geray Suinov
  • 3,521
  • 3
  • 16
  • 19

1 Answers1

0

But it doesn't work on IE < 10. And i need "convert" this using technology POST message. Earlier I did not worked with such things.

These are two completely separate and unrelated things.

The reason it doesn't work in IE < 10 is that IE < 10 doesn't support CORS with the standard XMLHttpRequest object that jQuery uses to provide the ajax function. IE8 and IE9 do support CORS, but only with the Microsoft-specific XDomainRequest object rather than XMLHttpRequest. jQuery does not provide this cross-browser behavior (see this issue in the jQuery issue tracker). There is at least one plug-in available that does, according to that ticket.

As for changing it from a GET to a POST, that's literally just changing

type: "GET",

to

type: "POST",

But again, it has nothing to do with the IE problem.

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
  • I wrote about the IE, because it was the initial reason of all problems. My issue - is to write a similar request using the post Message – Geray Suinov Jul 08 '13 at 15:46
  • @GeraySuinov: The second part of the answer should solve it, then. It literally is that small a change. – T.J. Crowder Jul 08 '13 at 15:46