zoukankan      html  css  js  c++  java
  • 更新 至jquery3.2 的方法改动

     1 $(window).load(function() {
     2     setHeight();
     3     $("#search").click(function() {
     4         traceFunc();
     5     });
     6     $("#backkey").bind("keyup", function(event) {
     7         if (event.keyCode == 13) {
     8             traceFunc();
     9         }
    10     });
    11     //检测统计
    12     $("#jiancshuju").load("index/index-yuhang!placeCheckSumShow.action?areaCode=330110");
    13 });

    对比:

     1 $(window).on('load',function() {
     2     setHeight();
     3     $("#search").click(function() {
     4         traceFunc();
     5     });
     6     $("#backkey").on("keyup", function(event) {
     7         if (event.keyCode == 13) {
     8             traceFunc();
     9         }
    10     });
    11     
    12     //检测统计
    13     $.ajax({
    14         async: false, 
    15         type : "POST",
    16         url : "index/index-yuhang!placeCheckSumShow.action?areaCode=330110",
    17         dataType : 'html',
    18         success : function(msg) {
    19             $("#jiancshuju").append(msg);
    20         }
    21     });
    22 });

    增加;

    1.  $ ("#id").attr("checked",false);  改为  $ ("#id").prop("checked",false);

    2.  $.browser.msie 判断浏览器

    附判断浏览器通用代码

     1      // Firefox 1.0+
     2         var isFirefox = typeof InstallTrigger !== 'undefined';
     3         alert("isFirefox:"+isFirefox);
     4         // Opera 8.0+
     5         var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
     6         alert("isOpera:"+isOpera);
     7         // Safari <= 9 "[object HTMLElementConstructor]"
     8         var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
     9         alert("isSafari:"+isSafari);
    10         // Internet Explorer 6-11
    11         var isIE = /*@cc_on!@*/ false || !!document.documentMode;
    12         alert("isIE:"+isIE);
    13         // Edge 20+
    14         var isEdge = !isIE && !!window.StyleMedia;
    15         alert("isEdge:"+isEdge);
    16         // Chrome 1+
    17         var isChrome = !!window.chrome && !!window.chrome.webstore;
    18         alert("isChrome:"+isChrome);
    19         // Blink engine detection(7)
    20         var isBlink = (isChrome || isOpera) && !!window.CSS;
    21         alert("isBlink:"+isBlink);
  • 相关阅读:
    schedule和scheduleAtFixedRate的区别
    JAVAWEB项目报"xxx响应头缺失“漏洞处理方案
    springboot整合swagger初探指南
    wsl安装jdk
    树莓派开机启动chrome并全屏
    数据库06_数据库设计
    数据库05_事务处理
    数据库04_SQL简单实践
    Spring-AOP
    数据库03_SQL语句
  • 原文地址:https://www.cnblogs.com/qq634571685/p/7872802.html
Copyright © 2011-2022 走看看