Skip to content

Instantly share code, notes, and snippets.

@ProdigyView
Created September 30, 2013 18:51
Show Gist options
  • Save ProdigyView/6768306 to your computer and use it in GitHub Desktop.
Save ProdigyView/6768306 to your computer and use it in GitHub Desktop.
Possible example of using Jquery AJAX for CORS in IEfunction
ieCreateHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument, locationProtocol, msie, xhr) {
if (!msie || msie > 9) return null;
return function (method, url, post, callback, headers, timeout, withCredentials) {
window.console.log(callback);
$.ajax({
url : url,
method : method,
success: function (respObj) {
completeRequest(callback, 200, respObj.responseText, 'Content-Type: ' + respObj.contentType);
},
error: function (data) {
completeRequest(callback, 500, 'Error', 'Content-Type: text/plain');
},
xhrFields : {
withCredentials : true
},
data : post
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment