摘要: window.onload = function(){ setTimeout(function(){ let t = performance.timing console.log('DNS查询耗时 :' + (t.domainLookupEnd - t.domainLookupStart).toFi 阅读全文
posted @ 2020-01-19 15:54 入坑的H 阅读(824) 评论(0) 推荐(0) 编辑
摘要: toFullScreen:全屏 function toFullScreen(){ let elem = document.body; elem.webkitRequestFullScreen ? elem.webkitRequestFullScreen() : elem.mozRequestFull 阅读全文
posted @ 2020-01-19 15:31 入坑的H 阅读(1020) 评论(0) 推荐(0) 编辑
摘要: function downloadFile(filename, data){ let DownloadLink = document.createElement('a'); if ( DownloadLink ){ document.body.appendChild(DownloadLink); D 阅读全文
posted @ 2020-01-19 15:28 入坑的H 阅读(806) 评论(0) 推荐(0) 编辑
摘要: function GetUrlParam(){ let url = document.location.toString(); let arrObj = url.split("?"); let params = Object.create(null) if (arrObj.length > 1){ 阅读全文
posted @ 2020-01-19 15:24 入坑的H 阅读(780) 评论(0) 推荐(0) 编辑
摘要: function getPropByPath(obj, path, strict) { let tempObj = obj; path = path.replace(/\[(\w+)\]/g, '.$1'); //将[0]转化为.0 path = path.replace(/^\./, ''); / 阅读全文
posted @ 2020-01-19 15:23 入坑的H 阅读(620) 评论(0) 推荐(0) 编辑
摘要: function dateFormater(formater, t){ let date = t ? new Date(t) : new Date(), Y = date.getFullYear() + '', M = date.getMonth() + 1, D = date.getDate(), 阅读全文
posted @ 2020-01-19 15:20 入坑的H 阅读(406) 评论(0) 推荐(0) 编辑
摘要: function unique(arr){ if(!isArrayLink(arr)){ //不是类数组对象 return arr } let result = [] let objarr = [] let obj = Object.create(null) arr.forEach(item => 阅读全文
posted @ 2020-01-19 15:18 入坑的H 阅读(593) 评论(0) 推荐(0) 编辑
摘要: function isPCBroswer() { let e = navigator.userAgent.toLowerCase() , t = "ipad" == e.match(/ipad/i) , i = "iphone" == e.match(/iphone/i) , r = "midp" 阅读全文
posted @ 2020-01-19 15:08 入坑的H 阅读(191) 评论(0) 推荐(0) 编辑
摘要: function getExplorerInfo() { let t = navigator.userAgent.toLowerCase(); return 0 <= t.indexOf("msie") ? { //ie < 11 type: "IE", version: Number(t.matc 阅读全文
posted @ 2020-01-19 15:06 入坑的H 阅读(196) 评论(0) 推荐(0) 编辑
摘要: //运行环境是浏览器let inBrowser = typeof window !== 'undefined';//运行环境是微信let inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;let wee 阅读全文
posted @ 2020-01-19 15:03 入坑的H 阅读(389) 评论(0) 推荐(0) 编辑