A good

Moreover I wont' be able to use any jQuery plugin (that directly
> references `jQuery`) in the admin (without hacking with
> ModelAdmin._media), because the `jQuery` object does not exist. I am
> forced to include jquery twice ...


Per the jQuery docs <http://docs.jquery.com/Plugins/Authoring>, plugins
should *not* directly reference the jQuery object; they should do it in a
scope-controlled closure executed at creation with jQuery passed to it as a
parameter. This way, plugins can safely use the $ shortcut without worrying
about whether or not noConflict mode is on, whether it is assigned to a
separate namespace (like django.jQuery), etc; you simply need to change the
parameter passed to the closure. In the case of django.jQuery, it should
look like this:

(function( $ ){
    $.fn.myPlugin = function() {
        this.each(function() {
            this.doSomething();
        });
    };
})( django.jQuery );

- CH

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to