08 2020 档案
摘要://判断手机设备 var u = navigator.userAgent; if(u.match(/iPhone/i) || u.match(/Android/i) || u.match(/iPod/i)){ console.log('手持设备') } //判断IPad设备 if(navigator
阅读全文
摘要:function getCookie(name){ var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); if(arr=document.cookie.match(reg)){ return unescape(arr[2]); }else{ re
阅读全文
摘要:js方法: parent.document; jquery方法: $('#test',parent.document); //此处的选择器为父页面的选择器
阅读全文
摘要:1、冒泡排序 var str = [12,55,33,66]; str.sort(_sort) function _sort(a,b){ if(a < b){ return -1; }else if(a > b){ return 1; }else{ return 0; } } 2、数组去重es6 v
阅读全文
摘要:参数 options 类型:Object 可选。AJAX 请求设置。所有选项都是可选的。 async 类型:Boolean 默认值: true。默认设置下,所有请求均为异步请求。如果需要发送同步请求,请将此选项设置为 false。 注意,同步请求将锁住浏览器,用户其它操作必须等待请求完成才可以执行。
阅读全文