Take care not to clobber any previously set window.$ value. IE, in its mysterious ways, sets $ to undefined if we have a conditional 'var $ = somefunc;' expression - even if the condition evaluates to false. Problem does not occur if expression is 'window.$ = somefunc;'. This makes OL play nicely with jQuery (among others) in IE. r=crschmidt (pullup #1391)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9400 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-05-21 00:17:20 +00:00
parent 5f0d573ff5
commit 6b6ca2a125
2 changed files with 12 additions and 3 deletions

View File

@@ -32,10 +32,10 @@ OpenLayers.Util.getElement = function() {
};
/**
* Maintain $() from prototype
* Maintain existing definition of $.
*/
if ($ == null) {
var $ = OpenLayers.Util.getElement;
if(typeof window.$ === "undefined") {
window.$ = OpenLayers.Util.getElement;
}
/**