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

深入浅出WebAssembly

深入浅出WebAssembly

于航 / 电子工业出版社 / 2018-11 / 128.00元

WebAssembly是一种新的二进制格式,它可以方便地将C/C++等静态语言的代码快速地“运行”在浏览器中,这一特性为前端密集计算场景提供了无限可能。不仅如此,通过WebAssembly技术,我们还可以将基于Unity等游戏引擎开发的大型游戏快速地移植到Web端。WebAssembly技术现在已经被计划设计成W3C的标准,众多浏览器厂商已经提供了对其MVP版本标准的支持。在Google I/O ......一起来看看 《深入浅出WebAssembly》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具