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);