Pylons/pyramid_debugtoolbar — Issue #38: Issue with conflicting jQuery modules
Author: ztane
Created: 2011-10-14 12:33:14+00:00
State: open

we use $(function() {}), aka ondomready quite extensively. After enabling debugtoolbar we found out that the global $ object did not contain necessary extensions anymore. This is probably caused by the debug toolbar fragment (https://github.com/Pylons/pyramid_debugtoolbar/blob/master/pyramid_debugtoolbar/templates/toolbar.jinja2#L11) injecting the scripts in separate elements;

Now, we have seen some browsers, e.g. Chrome, parsing the body scripts in order, the onDomReady event is sometimes (quite often actually) fired after the debug toolbar's jQuery has been loaded, but before $.noConflict() is called.

Thus, 2 things should be changed.

1) $.noConflict(true) should be used to remove the jQuery variable too
2) all these scripts should be catenated, and even then they should refer to $ only by closure.