随笔分类 - web前端
摘要:回复: “频繁操作”,pushState也好、replaceState也好是很耗资源的,所以频繁操作一定次数后,浏览器处于安全考虑就不再响应,过一段时间后恢复正常。
阅读全文
摘要:function get_cache_size(t){ t = t == undefined ? "l" : t; var obj = ""; if(t 'l'){ if(!window.localStorage) { console.log('浏览器不支持localStorage'); }else
阅读全文
摘要:window.history.pushState("","","#"); window.addEventListener("popstate",function(e){ window.location.href = location.href;//这里指定你要跳转的页面 }
阅读全文
摘要:在vue文件中,做样式分离: 将覆盖样式单独写在一个style标签内,原页面写在 scoped样式作用域下。
阅读全文
摘要:1、简介W3C官方对manifest的介绍是HTML5 引入了应用程序缓存,这意味着 web 应用可进行缓存,并可在没有因特网连接时进行访问。 应用程序缓存为应用带来三个优势: 离线浏览 - 用户可在应用离线时使用它们速度 - 已缓存资源加载得更快减少服务器负载 - 浏览器将只从服务器下载更新过或更
阅读全文
摘要:HTML5现在越来越流行了,但是一遇到IE低版本浏览器就傻眼了,今天整理了一下一些解决办法。 html5shiv:解决ie9以下浏览器对html5新增标签的不识别,并导致CSS不起作用的问题。 respond.min:让不支持css3 Media Query的浏览器包括IE6-IE8等其他浏览器支持
阅读全文
摘要:img标签实现和背景图一样的显示效果——object-fit和object-position
阅读全文
摘要:解决办法:重写user-select样式 css: user-select: text;-webkit-user-select:text;
阅读全文
摘要:function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return decodeURI(r[2]); return null; }
阅读全文
摘要:function delParam(paramKey) { var url = window.location.href; //页面url var urlParam = window.location.search.substr(1); //页面参数 var beforeUrl = url.substr(0, url.indexOf("?")); //页面主地址(参数之前地址) var nextU
阅读全文
摘要:描述: 设置 AJAX 请求默认地址为 "/xmlhttp/",禁止触发全局 AJAX 事件,用 POST 代替默认 GET 方法。其后的 AJAX 请求不再设置任何选项参数。
阅读全文
摘要:<html> <head> <p style="font-size: 20px;color: red;">使用a标签方式将json导出csv文件</p> <button onclick='tableToExcel()'>导出</button> </head> <body> <script> function tableToExcel(){ //要导出的json数据 const jsonData =
阅读全文
摘要:https://www.cnblogs.com/lsgxeva/p/10120275.html
阅读全文
摘要:var win_h = $(window).height();//关键代码 window.addEventListener('resize', function () { if($(window).height() < win_h){ $('.share-btn-box').hide(); }else{ $('.share-btn-box').sh...
阅读全文
摘要:/* iphoneX、iphoneXs */ @media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3){ .bottom{bottom: 34px;} .lastp{pad...
阅读全文
摘要:var thisExtends = function () { var args = [].slice.call(arguments).filter(function (item) { return item.mi !== undefined; }); return args; ...
阅读全文
摘要:两者区别: call(this,1,2,3,4):一个是函数运行的作用域(this),另一个是必须列举出来的参数。 apply(this,arguments):一个是函数运行的作用域(this),另一个是参数数组。 两者相同点: 1、都是在特定的作用域中调用函数,等于设置函数体内this对象的值,以
阅读全文
摘要:input{-webkit-appearance: none; -moz-appearance: none; -o-appearance: none; appearance: none;}
阅读全文
摘要:html,body{-webkit-text-size-adjust: 100%;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}
阅读全文
摘要:对需要禁用的div或者body设置下面样式-webkit-user-select: none;
阅读全文