If you include 2 version of jQuery in a page how do you restrict a plugin to just one of them?

前端 未结 2 1570
陌清茗
陌清茗 2021-01-06 19:22

So this question isn\'t as crazy as it might sound at first. I\'m developing a piece of javascript code to drop into my client\'s pages. What I\'m worried about is if they

2条回答
  •  时光取名叫无心
    2021-01-06 20:04

    There is a trick you could use. If your version of jQuery is second which loads, you will need first move to safety theirs version before you load it, something like this

    
    

    Then add your jQuery version script include tag

    
     
    
    
    

    then add another script block with folowing

    
    

    after this you can access your jquery version with $$ shortcut

提交回复
热议问题