how to use jquery.noConflict property

后端 未结 4 819
轻奢々
轻奢々 2020-12-09 00:39

I am testing my webpage on a server using preview dns. Just realized that preview dns automatically adds mootools library towards the end of any php page. Probably for thei

4条回答
  •  一个人的身影
    2020-12-09 00:59

    I prefer using a self executing anonymous function to give your jQuery code its own scope where you can use $ as you normally would if you didn't have to worry about compatability.

    This is going to look weird if you haven't seen it before. Basically, what I did was define a function that takes a parameter (the $) and then execute that function with jQuery as the parameter.

    
    

提交回复
热议问题