[OpenLayers-Trac] [OpenLayers] #1391: $ in openlayers lib conflicts with jquery

OpenLayers trac at openlayers.org
Sat Mar 1 03:33:04 EST 2008


#1391: $ in openlayers lib conflicts with jquery
----------------------+-----------------------------------------------------
  Reporter:  jpulles  |       Owner:               
      Type:  bug      |      Status:  new          
  Priority:  major    |   Milestone:  2.7 Release  
 Component:  Util     |     Version:  SVN          
Resolution:           |    Keywords:  jquery drupal
     State:           |  
----------------------+-----------------------------------------------------
Comment (by jpulles):

 Replying to [comment:3 ahocevar]:
 > Yes, the script loading order is a problem in IE. If you want to make
 sure that you use the jquery $ function, you should add the following at
 the top of your onload method:
 > {{{
 > window.$ = function(selector, context) {
 >     return new jQuery.prototype.init(selector, context);
 > }
 > }}}
 > This is just a re-definition of the jquery $ function.

 Thank you for the tip. I now changed it to "window.$ = window.jQuery;"
 which has the same effect.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/1391#comment:4>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list