摘要: 1. 设备像素比 iphone3的分辨率为320x480,1个css像素等于一个屏幕物理像素 iphone4的分辨率为640x960(苹果公司便推出了所谓的Retina屏),分辨率提高了一倍,导致同样大的屏幕上像素多了一倍,安卓设备上分为ldpi、mdpi、hdpi、xhdpi等不同的等级 wind 阅读全文
posted @ 2018-05-09 17:34 silent☺ 阅读(101) 评论(0) 推荐(0)
摘要: 简单来说,浏览器缓存就是把一个已经请求过的Web资源(如html页面,图片,js,数据等)拷贝一份副本储存在浏览器中。缓存会根据进来的请求保存输出内容的副本。当下一个请求来到的时候,如果是相同的URL,缓存会根据缓存机制决定是直接使用副本响应访问请求,还是向源服务器再次发送请求。比较常见的就是浏览器 阅读全文
posted @ 2018-05-09 17:27 silent☺ 阅读(677) 评论(0) 推荐(0)
摘要: body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { margin: 0; padding: 0;} body { b 阅读全文
posted @ 2018-05-09 17:21 silent☺ 阅读(105) 评论(0) 推荐(0)
摘要: 1.判断是否为IE浏览器 function isIE() { if(!!window.ActiveXObject || "ActiveXObject" in window){ return "IE" }else{ return "!IE" } }console.log(isIE()); 2.判断浏览 阅读全文
posted @ 2018-05-09 17:17 silent☺ 阅读(111) 评论(0) 推荐(0)
摘要: 1、获取当前域名: location.hostname 2、html字段值取值 this.onPostValue="<p> </p>" this.onPostValue.replace(/<\/?.+?>/g,"") 3、去除所有特殊符号 var str=phone.replace(/[\ |\~| 阅读全文
posted @ 2018-05-09 16:03 silent☺ 阅读(79) 评论(0) 推荐(0)
摘要: 1、控制面板执行命令 1、npm install -g cnpm --registry=https://registry.npm.taobao.org 2、npm config set registry https://registry.npm.taobao.org 3、cnpm install - 阅读全文
posted @ 2018-05-09 15:53 silent☺ 阅读(122) 评论(0) 推荐(0)
摘要: 1、forEach中用break是不能中断循环的,使用return也不能返回到外层函数 2、for in更适合遍历对象,不适合遍历数组(遍历的是索引) 3、for of遍历的是数组元素值 阅读全文
posted @ 2018-05-09 15:18 silent☺ 阅读(95) 评论(0) 推荐(0)