Putting the loader code into an self-executed function so that we don't have problems with global scope variables, Closes #3076

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11196 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
pgiraud
2011-02-21 15:39:14 +00:00
parent 07160f5385
commit 2908fa79e5
+2 -1
View File
@@ -1,7 +1,7 @@
// Adding a mode parameter with "build" as value in the run-tests.html will // Adding a mode parameter with "build" as value in the run-tests.html will
// make usage of the build version of the library. // make usage of the build version of the library.
// get the OLLoader.js script location // get the OLLoader.js script location
(function() {
var r = new RegExp("(^|(.*?\\/))(" + "OLLoader.js" + ")(\\?|$)"), var r = new RegExp("(^|(.*?\\/))(" + "OLLoader.js" + ")(\\?|$)"),
s = document.getElementsByTagName('script'), s = document.getElementsByTagName('script'),
src, m, l = ""; src, m, l = "";
@@ -23,3 +23,4 @@ l += (results && results[1] == 'build') ?
"../build/OpenLayers.js" : "../lib/OpenLayers.js"; "../build/OpenLayers.js" : "../lib/OpenLayers.js";
scriptTag = "<script src='" + l + "'></script>"; scriptTag = "<script src='" + l + "'></script>";
document.write(scriptTag); document.write(scriptTag);
})();