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

前端 未结 2 1740
野趣味
野趣味 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:48

    In addition to what Bhojendra Nepal's answer, You can also check the version of jQuery through the following Code :

    var jq_version = $().jquery;
        console.log(jq_version);
        /* gives the version number like 1.7.1. So may be you can write an if condition around the version number. For e.g :*/
        if(jq_version == '1.7.1'){
            //do something for ver 1.7.1
        }
    

    There are even more ways to Check the version of jQuery. But I'm not sure if that would help much with the CISCO library you are using.

提交回复
热议问题