jQuery Plugin Check Version

前端 未结 15 904
轮回少年
轮回少年 2020-12-16 11:57

When writing a new jQuery plugin is there a straightforward way of checking that the current version of jQuery is above a certain number? Displaying a warning or logging an

15条回答
  •  离开以前
    2020-12-16 12:14

    Found this in jquery.1.3.2 source:

     jQuery.fn = jQuery.prototype = {
        init: function( selector, context ) {
        .....
        // The current version of jQuery being used
        jquery: "1.3.2",
    

    I didn't check, but something like "$.fn.jQuery" might work.

提交回复
热议问题