Author: alexsmirnov
Date: 2010-03-23 20:23:17 -0400 (Tue, 23 Mar 2010)
New Revision: 16660
Modified:
branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/swfobject.js
Log:
https://jira.jboss.org/jira/browse/RF-8541
Modified:
branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/swfobject.js
===================================================================
---
branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/swfobject.js 2010-03-23
23:06:53 UTC (rev 16659)
+++
branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/swfobject.js 2010-03-24
00:23:17 UTC (rev 16660)
@@ -107,11 +107,12 @@
addDomLoadEvent(main);
if (ua.ie && ua.win) {
try { // Avoid a possible Operation Aborted error
- doc.write("<scr" + "ipt id=__ie_ondomload defer=true
src=//:></scr" + "ipt>"); // String is split into pieces to avoid
Norton AV to add code that can cause errors
- script = getElementById("__ie_ondomload");
- if (script) {
- addListener(script, "onreadystatechange", checkReadyState);
- }
+ var head = doc.getElementsByTagName("head")[0]||document.documentElement;
+ script = doc.createElement("script");
+ script.setAttribute("defer","defer");
+ script.setAttribute("src","//:");
+ head.appendChild(script);
+ addListener(script, "onreadystatechange", checkReadyState);
}
catch(e) {}
}
@@ -126,7 +127,7 @@
function checkReadyState() {
if (script.readyState == "complete") {
- script.parentNode.removeChild(script);
+ if(script.parentNode){script.parentNode.removeChild(script);};
callDomLoadFunctions();
}
}