How to change Namespace of jQuery?

前端 未结 2 1575
执笔经年
执笔经年 2020-12-11 11:37

I\'m working on a library which uses jQuery internally which work fine. But I don\'t want force the user to use my jQuery version just because he uses my library in his code

2条回答
  •  执念已碎
    2020-12-11 12:16

    By specifying true in the jQuery.noConflict(true);, it sets the noConflict to extreme mode and should make it so it won't conflict with any other library. It should be the first thing you define anywhere I'm guessing, so no jQuery code/plugin should appear before the var mylib.jQuery = jQuery.noConflict(true);

提交回复
热议问题