cache the result of the OpenLayers._getScriptLocation function. r=ahocevar (closes #2389)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9935 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -17,6 +17,12 @@
|
||||
*/
|
||||
var singleFile = (typeof OpenLayers == "object" && OpenLayers.singleFile);
|
||||
|
||||
/**
|
||||
* Cache for the script location returned from
|
||||
* OpenLayers._getScriptLocation
|
||||
*/
|
||||
var scriptLocation;
|
||||
|
||||
/**
|
||||
* Namespace: OpenLayers
|
||||
* The OpenLayers object provides a namespace for all things OpenLayers
|
||||
@@ -37,7 +43,10 @@
|
||||
* {String} Path to this script
|
||||
*/
|
||||
_getScriptLocation: function () {
|
||||
var scriptLocation = "";
|
||||
if(scriptLocation) {
|
||||
return scriptLocation;
|
||||
}
|
||||
scriptLocation = "";
|
||||
var isOL = new RegExp("(^|(.*?\\/))(" + OpenLayers._scriptName + ")(\\?|$)");
|
||||
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
|
||||
Reference in New Issue
Block a user