jQuery: noConflict

后端 未结 8 2115
無奈伤痛
無奈伤痛 2020-12-01 12:25

I just cannot work this out. My god it\'s making my brain hurt, so I turn to you, the good people of the internet.

I\'ve been staring at the documentation for the jQ

8条回答
  •  遥遥无期
    2020-12-01 13:10

    jQuery no-conflict is an option given by jQuery team to overcome the conflicts between the different JS frameworks or libraries. We are replacing the $ to a new variable and assigning to jQuery when we use the noconflict method.

        
        
    

    We can use the $ sign like below also, it not create any conflict also

    $.noConflict();
    jQuery(document).ready(function($) {
       // Code that uses jQuery's $ can follow here.
    });
    

提交回复
热议问题