摘要:
跨域可以使用谷歌的插件解决:https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi 或者谷歌开启允许跨域,参考 http://camnpr.com/arc 阅读全文
摘要:
HTML CSS 阅读全文
摘要:
1.constructor 在W3C定义中的定义:constructor 属性返回对创建此对象的数组函数的引用 就是返回对象相对应的构造函数。从定义上来说跟instanceof不太一致,但效果都是一样的 如: (a instanceof Array) //a是否Array的实例?true or fa 阅读全文
摘要:
SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass 阅读全文
摘要:
if(navigator.userAgent.toLowerCase().toString().indexOf('qqbrowser') > -1){ console.log('qq');}else{ console.log('other');} 阅读全文
摘要:
手机号:var reg = /^1[34578]\d{9}$/; 手机号和座机:var reg=/^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/; if (!reg.test(Telphone)) { $dialog.module.init({ content: '手机号格式不正确', ... 阅读全文
摘要:
npm config set registry https://registry.npm.taobao.org --globalnpm config set disturl https://npm.taobao.org/dist --global 阅读全文
摘要:
1. 使用最新版本的jQuery jQuery的版本更新很快,你应该总是使用最新的版本。因为新版本会改进性能,还有很多新功能。 下面就来看看,不同版本的jQuery性能差异有多大。这里是三条最常见的jQuery选择语句: $('.elem') $('.elem', context) context. 阅读全文
摘要:
1.判断浏览器类型 if navigator.userAgent.indexOf(”MSIE”)>0) {} //判断是否IE浏览器 if(isFirefox=navigator.userAgent.indexOf(”Firefox”)>0){ }判断是否火狐浏览器 if(isSafari=navi 阅读全文
摘要:
$(" body").click(function(){ $("#div").hide(); }); $("button").click(function(e){ $("div").show(); e.stopPropagation();//阻止冒泡到body }); $("#div").click 阅读全文