If we're not running under IE, we should append script tags via the DOM.

This works in Safari, Firefox, Opera, and we check for IE and do it the old
way for them. Closes #177 . 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1540 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-10-03 14:11:43 +00:00
parent 7e11c37610
commit 634588abf0

View File

@@ -108,9 +108,18 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
catch (e) { start=0; }
for (var i = start; i < jsfiles.length; i++) {
var currentScriptTag = "<script src='" + host + jsfiles[i] + "'></script>";
allScriptTags += currentScriptTag;
if (/MSIE/.test(navigator.userAgent)) {
var currentScriptTag = "<script src='" + host + jsfiles[i] + "'></script>";
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);
})();
}