Using JQuery and Prototype in the same page

前端 未结 12 1228
忘了有多久
忘了有多久 2020-11-30 03:39

Several of my pages use both JQuery and Protoype. Since I upgraded to version 1.3 of JQuery this appears to be causing problems, because both libraries define a function nam

12条回答
  •  长情又很酷
    2020-11-30 04:41

    This solution worked fine:

    jQuery.noConflict();
    var $j = jQuery;
    

    Now use $j in place of $ for your jQuery code, like:

    $j(document).ready(function() {
        $j('#div_id').innerfade({
             // some stuff
        });
    });
    

提交回复
热议问题