zoukankan      html  css  js  c++  java
  • jQuery.support的实现方式

         jQuery.support 用于检查浏览器对各项特性的支持。检查项多达 27 个。
         首先,让我们用一段代码测试一下 support 中包含的检查项:

    <script src='jquery.js'></script>
    <script>
    support = $.support;
    for (key in support) {
        document.write('support.' + key + ' = ' + support[key] + '<br />');
    }
    </script>


    IE 下的输出结果为:

    support.leadingWhitespace = false
    support.tbody = false
    support.htmlSerialize = false
    support.style = false
    support.hrefNormalized = false
    support.opacity = false
    support.cssFloat = false
    support.checkOn = true
    support.optSelected = false
    support.getSetAttribute = false
    support.submitBubbles = false
    support.changeBubbles = false
    support.focusinBubbles = true
    support.deleteExpando = false
    support.noCloneEvent = false
    support.inlineBlockNeedsLayout = false
    support.shrinkWrapBlocks = true坏帐
    support.reliableMarginRight = true
    support.noCloneChecked = false
    support.optDisabled = true
    support.radioValue = false
    support.checkClone = undefined
    support.appendChecked = false
    support.boxModel = false
    support.reliableHiddenOffsets = false
    support.ajax = true
    support.cors = false

    FireFox 中的显示结果为:

    support.leadingWhitespace = true
    support.tbody = true
    support.htmlSerialize = true
    support.style = true
    support.hrefNormalized = true
    support.opacity = true
    support.cssFloat = true
    support.checkOn = true
    support.optSelected = true
    support.getSetAttribute = true
    support.submitBubbles = true
    support.changeBubbles = true
    support.focusinBubbles = false
    support.deleteExpando = true
    support.noCloneEvent = true
    support.inlineBlockNeedsLayout = false
    support.shrinkWrapBlocks = false
    support.reliableMarginRight = true
    support.noCloneChecked = true
    support.optDisabled = true
    support.radioValue = true淘宝女装夏装新款
    support.checkClone = undefined
    support.appendChecked = true
    support.boxModel = true
    support.reliableHiddenOffsets = true
    support.ajax = true
    support.cors = true

  • 相关阅读:
    微软程序员最好的时代来了
    领域驱动设计系列 (六):CQRS
    当我谈 "加班有罪" 我在谈什么?
    parquet 简介(转)
    Spark动态资源分配-Dynamic Resource Allocation
    Spark配置参数详解
    PhpStorm使用sftp实现代码自动上传服务器
    docker 命令大全
    mysql 5.6配置
    docker volume
  • 原文地址:https://www.cnblogs.com/sky7034/p/2047495.html
Copyright © 2011-2022 走看看