Is it possible to load multiple different version of jQuery on the same page?

前端 未结 4 1463
天命终不由人
天命终不由人 2020-12-17 03:13

I\'m making a bookmarklet which will load jQuery if the object is not found. The loading will check on the version of jQuery. The code is like:

(function(){
         


        
4条回答
  •  悲&欢浪女
    2020-12-17 04:15

    I suspect you've already seen all the caveats and understand you can move jQuery to another namespace:

    //Completely move jQuery to a new namespace in another object.
    
    var dom = {};
    dom.query = jQuery.noConflict(true);
    

    And that plugins probably won't work AND you must do all this before other scripts are loaded or used.

    Good Luck / kinda curious to learn if this works for you~

提交回复
热议问题