add addScript() function for loading JSON scripts (or any scripts, for that matter)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@984 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-20 13:46:33 +00:00
parent 9a5f6c8d33
commit b6e937e877

View File

@@ -106,3 +106,13 @@ OpenLayers.parseXMLString = function(text) {
return ajaxResponse;
};
/**
* @param {String} url
*/
OpenLayers.addScript = function(url) {
var head = document.getElementsByTagName("HEAD")[0];
var scriptElem = document.createElement("script");
scriptElem.src = url;
head.appendChild(scriptElem);
};