jQuery Version

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-12 06:43:46

软件介绍

A Plugin to help determine the version of jQuery.

Code:

function jQueryVersion()
{
    var ver = (new jQuery()).jquery;
    // if there are two .'s it is a bug fix release
    if(ver.match(/\./g).length == 2)
    {
        return {
            "version" : ver,
            "major" : ver.substr(0, ver.indexOf(".")),
            "minor" : ver.substr(ver.indexOf(".") + 1, ver.lastIndexOf(".") - ver.indexOf(".") - 1),
            "revision" : ver.substr(ver.lastIndexOf(".") + 1)
        }
    }
    // otherwise it is an initial release
    else
    {
        return {
            "version" : ver,
            "major" : ver.substr(0, ver.indexOf(".")),
            "minor" : ver.substr(ver.indexOf(".") + 1),
            "revision" : 0
        }
    }
}

Usage example:
jQuery.fn.myplugin = function()
{
    var version = jQueryVersion();
    if(parseInt(version.minor) < 1)
    {
        alert("jQuery version 1.1 or higher is required for myplugin");
        return this;
    }
}

本文地址:https://codercto.com/soft/d/23191.html

Programming in Haskell

Programming in Haskell

Graham Hutton / Cambridge University Press / 2007-1-18 / GBP 34.99

Haskell is one of the leading languages for teaching functional programming, enabling students to write simpler and cleaner code, and to learn how to structure and reason about programs. This introduc......一起来看看 《Programming in Haskell》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

随机密码生成器
随机密码生成器

多种字符组合密码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具