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

PHP and MySQL Web Development (3rd Edition) (Developer's Library

PHP and MySQL Web Development (3rd Edition) (Developer's Library

Luke Welling、Laura Thomson / Sams / 2004-09-29 / USD 49.99

We've taken the best and made it even better. The third edition of the best-selling PHP and MySQL Web Development has been updated to include material and code on MySQL 5, PHP 5 and on PHPs object mod......一起来看看 《PHP and MySQL Web Development (3rd Edition) (Developer's Library》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

html转js在线工具
html转js在线工具

html转js在线工具