fix scriptloading on old ie
This commit is contained in:
parent
e7b952a55e
commit
4319abf256
1 changed files with 10 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* based on code from:
|
* based on code from:
|
||||||
*
|
*
|
||||||
* @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
|
* @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
|
||||||
* Available via the MIT or new BSD license.
|
* Available via the MIT or new BSD license.
|
||||||
* see: http://github.com/jrburke/requirejs for details
|
* see: http://github.com/jrburke/requirejs for details
|
||||||
|
|
@ -8,6 +8,8 @@
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var useragent = require("ace/lib/useragent");
|
||||||
|
|
||||||
exports.get = function (url, callback) {
|
exports.get = function (url, callback) {
|
||||||
var xhr = exports.createXhr();
|
var xhr = exports.createXhr();
|
||||||
xhr.open('GET', url, true);
|
xhr.open('GET', url, true);
|
||||||
|
|
@ -55,8 +57,13 @@ exports.loadScript = function(path, callback) {
|
||||||
|
|
||||||
s.src = path;
|
s.src = path;
|
||||||
head.appendChild(s);
|
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