fix scriptloading on old ie
This commit is contained in:
parent
e7b952a55e
commit
4319abf256
1 changed files with 10 additions and 3 deletions
|
|
@ -8,6 +8,8 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var useragent = require("ace/lib/useragent");
|
||||
|
||||
exports.get = function (url, callback) {
|
||||
var xhr = exports.createXhr();
|
||||
xhr.open('GET', url, true);
|
||||
|
|
@ -56,7 +58,12 @@ exports.loadScript = function(path, callback) {
|
|||
s.src = path;
|
||||
head.appendChild(s);
|
||||
|
||||
s.onload = callback;
|
||||
if (useragent.isOldIE)
|
||||
s.onreadystatechange = function () {
|
||||
this.readyState == 'loaded' && callback();
|
||||
};
|
||||
else
|
||||
s.onload = callback;
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue