Search code examples
javascriptjqueryprototypejs

Conflict between Prototype and jQuery


I'm trying to use the jQuery Datepicker and a JavaCcript scrollbar on one page. But if I declare both in the header file one does not work, is there a way I can fix this but still use both? I've tried the following but to no success:

var $j = jQuery.noConflict();
$j("#datepicker").datepicker();

Solution

  • You can resolve conflict and still use $ like this:

    jQuery(function($){
        $("#datepicker").datepicker();
    })(jQuery)