Why does including prototype.js break the functioning of jquery bbq?

前端 未结 2 1622
攒了一身酷
攒了一身酷 2021-01-23 14:53

I have:

    



    




        
2条回答
  •  南方客
    南方客 (楼主)
    2021-01-23 15:12

    By including prototype.js after jQuery, Prototype will override the value of the global $ variable. You just need to use:

    var $j = jQuery.noConflict();
    

    You can then use $j in place of $ in jQuery contexts and $ for prototype contexts. Here's the documentation: http://api.jquery.com/jQuery.noConflict/.

提交回复
热议问题