Mozilla's own specification says that it should be simple GETor POSTshould initially be CORS without first checking, but so far every attempt POSTI've made has resulted in a header OPTIONS. When I change it from POSTto get the code, it immediately sends the correct request GETso that part of the cross site works fine.
Here is an example of what I'm doing in firefox:
var destinationUrl = 'http://imaginarydevelopment.com/postURL';
var invocation = new XMLHttpRequest();
if (invocation) {
invocation.open('POST', destinationUrl, true);
invocation.onreadystatechange = (function Handler() {
if (invocation.readyState == 4)
alert('Request made');
});
invocation.send();
}
Here is what I already worked in chrome and IE:
var destinationUrl = 'http://imaginarydevelopment.com/postURL';
var destination = { url: destinationUrl, type: 'POST', success: AjaxSuccess, error: AjaxError,
dataType: 'text', contentType: 'application/x-www-form-urlencoded'
};
destination.data = { 'rows': rowList, 'token': token };
$jq.ajax(destination);
source
share