From 9615c33fe8d1f7175f53817c68aad07e152165f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Wed, 21 Jul 2010 10:26:54 +0000 Subject: [PATCH] Fixed JS loadFinished notification on IE --- phpgwapi/js/egw_json.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/phpgwapi/js/egw_json.js b/phpgwapi/js/egw_json.js index 5cb2677f28..84ae4d455e 100644 --- a/phpgwapi/js/egw_json.js +++ b/phpgwapi/js/egw_json.js @@ -432,17 +432,28 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe }; //IE - scriptnode.onreadystatechange = function() { - var node = window.event.srcElement; - if (node.readyState == 'complete') { - var file = node._originalSrc; - if (typeof console != 'undefined' && typeof console.log != 'undefined') - console.log("Retrieved JS file '%s' from server", [file]); + if (typeof scriptnode.readyState != 'undefined') + { + if (scriptnode.readyState != 'complete' && + scriptnode.readyState != 'loaded') + { + scriptnode.onreadystatechange = function() { + var node = window.event.srcElement; + if (node.readyState == 'complete' || node.readState == 'loaded') { + var file = node._originalSrc; + if (typeof console != 'undefined' && typeof console.log != 'undefined') + console.log("Retrieved JS file '%s' from server", [file]); - self.loadedJSFiles[file] = true; - self.checkLoadFinish(); + self.loadedJSFiles[file] = true; + self.checkLoadFinish(); + } + }; } - }; + else + { + this.loadedJSFiles[res.data] = true; + } + } } hasResponse = true; } else