diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js
index c8f80cf6ae..a2f0463497 100644
--- a/lib/OpenLayers.js
+++ b/lib/OpenLayers.js
@@ -108,9 +108,18 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
catch (e) { start=0; }
for (var i = start; i < jsfiles.length; i++) {
- var currentScriptTag = "";
- allScriptTags += currentScriptTag;
+ if (/MSIE/.test(navigator.userAgent)) {
+ var currentScriptTag = "";
+ allScriptTags += currentScriptTag;
+ } else {
+ var s = document.createElement("script");
+ s.src = host + jsfiles[i];
+ var h = document.getElementsByTagName("head").length ?
+ document.getElementsByTagName("head")[0] :
+ document.body;
+ h.appendChild(s);
+ }
}
- document.write(allScriptTags);
+ if (allScriptTags) document.write(allScriptTags);
})();
}