Skip to content

Instantly share code, notes, and snippets.

@domguard
Created July 3, 2012 16:10
Show Gist options
  • Save domguard/3040742 to your computer and use it in GitHub Desktop.
Save domguard/3040742 to your computer and use it in GitHub Desktop.
Using django.jQuery with another jQuery
(function($){
//console.log($.fn.jquery) // which jquery are we using ?
$(function(){
$("select[name$='-etype']").each(function(){
show_target_methods($(this));
});
$("select[name$='-etype']").bind("change",function(e){
console.log($(this));
show_target_methods($(this),true);
});
});
})((typeof window.jQuery == 'undefined' && typeof window.django != 'undefined') ? django.jQuery : jQuery);
// si jQuery 1.7 est pas encore chargé et que django.jQuery l'est, il prendra celui de django admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment