I wrote my own jquery plugin and was surprised that I haven’t access to it inside $(document).ready function.
I wrote this testpage and was surprised even more:
//jQuery anchor plugin
(function ($) {
$.anchor = {
hashTrim: /^.*#/,
}
})(jQuery);
console.log($.ajax);
console.log($.anchor);
$(function () {
console.log($.ajax);
console.log($.anchor);
});
I’v got 4 complettely different values in firebug console. Do somebody know and can describe me why is it so? And main question – how I can have access to my $.anchor variable inside $(function() {} ???
Thanks!
UPDATE:
I just catch the problem – django-debug-toolbar. When I disabled it, everythings gets fine!
Does anyone know how to make friendship between jquery and django-debug-toolbar?
I partially solve this problem by switching to the another fork – alex’s django_debug_toolbar.
But I think it’s more ugly, then david cramer’s django_debug_toolbar, that I use before and which contains this problem with jQuery. I hope to move functionality for avoiding this problem from alex’s to dcramer’s fork in future.