How to use different version of JQuery on a JS file?

前端 未结 2 1738
野趣味
野趣味 2020-12-12 07:01

I have a Cisco JS library designed to work using JQuery 1.4.2 and I\'m using latest 2.X version of JQuery on the UI page I\'m developing.

Cisco Library

2条回答
  •  攒了一身酷
    2020-12-12 07:34

    When you use different version of jquery then your code conflicts. So there may appear obvious errors.

    To fix it, you need to use $.noConflict() passing a boolean parameter true.

    jQuery.noConflict(true);
    //removes jquery itself and allows you to work with different version of jquery
    

    Example:

    
    
    
    
    
    

提交回复
热议问题