From 16d4eb77c8017e0096eb1daa053cf58882420dbb Mon Sep 17 00:00:00 2001 From: Pepe Bawagan Date: Sun, 1 Jun 2014 21:44:10 +0800 Subject: [PATCH] always use XMLHttpRequest current behavior will use XDomainRequest whenever it is available even though the request is not necessarily CORS. this creates a problem when on certain browsers (e.g. ie10) because: - Access-Control-Allow-Origin header is expected despite the request not being CORS - XDR does not have an onreadystatechange function (http://msdn.microsoft.com/en-us/library/ie/cc288060(v=vs.85).aspx) and use of its proper callback functions appear to have not yet been implemented --- mithril.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index b3b260fd..be9fd8f1 100644 --- a/mithril.js +++ b/mithril.js @@ -453,7 +453,7 @@ Mithril = m = new function app(window) { function identity(value) {return value} function ajax(options) { - var xhr = window.XDomainRequest ? new window.XDomainRequest : new window.XMLHttpRequest + var xhr = new window.XMLHttpRequest xhr.open(options.method, options.url, true, options.user, options.password) xhr.onreadystatechange = function() { if (xhr.readyState === 4) {