How to change Namespace of jQuery?

前端 未结 2 1581
执笔经年
执笔经年 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 11:58

    You'd have to go into the source because window.jQuery is defined there, and just update the reference name.

    This seems like an unreasonable request though.

    Edit: Looks like all you have to do is set the reference to $.noConflict:

    
    
    

    You'd have to do this right after you include the script though. My previous way did it directly in the script:

    http://173.45.226.115/jquery.html

提交回复
热议问题