1
0
Fork 0
forked from 0x2620/oxjs
This commit is contained in:
j 2012-05-25 16:28:05 +00:00
commit eb9cd1e397
9 changed files with 34 additions and 9 deletions

View file

@ -87,7 +87,12 @@ window.Ox = {
function loadScript(script, callback) {
var element = document.createElement('script'),
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
element.onload = callback;
if (/MSIE/.test(navigator.userAgent)) {
// fixme: find a way to check if css/js have loaded in msie
setTimeout(callback, 2500);
} else {
element.onload = callback;
}
element.src = path + script + '?' + parseInt(Math.random() * 1000000);
element.type = 'text/javascript';
head.appendChild(element);