- 博客(6)
- 收藏
- 关注
转载 null undifined 区别
转载自:http://www.ruanyifeng.com/blog/2014/03/undefined-vs-null.html 大多数计算机语言,有且仅有一个表示"无"的值,比如,C语言的NULL,Java语言的null,Python语言的None,Ruby语言的nil。 有点奇怪的是,JavaScript语言居然有两个表示"无"的值:undefined和null。这是为什么? undefin...
2019-03-05 17:10:45
331
转载 最好不要用new(YUI 团队)
JavaScript is a prototypal language, but it has a new operator that tries to make it look sort of like a classical language. That tends to confuse programmers, leading to some problematic programming ...
2019-03-05 16:55:48
280
转载 js 构造函数 new运算符
JS中的函数即可以是构造函数又可以当作普通函数来调用,当使用new来创建对象时,对应的函数就是构造函数,通过对象来调用时就是普通函数。 普通函数的创建有:显式声明、匿名定义、new Function() 等三种方式。 当通过new来创建一个新对象时,JS底层将新对象的原型链指向了构造函数的原型对象,于是就在新对象和函数对象之间建立了一条原型链,通过新对象可以访问到函数对象原型prototype中的...
2019-03-05 16:07:14
444
原创 ios12 键盘弹起不回落 bug
if(/os 12/ig.test(navigator.userAgent)){ document.body.addEventListener(“blur”,function(){ window.scrollTo(0,0); },true); }
2018-12-05 17:30:17
1832
原创 移动端禁止触摸滑动
阻止默认行为函数 function preventDefault(e) { e.preventDefault(); } 禁用触摸滚动页面 document.addEventListener(‘touchmove’, preventDefault, {passive: false}); 恢复触摸滚动页面 document.removeEventListener(‘touchmove’, preven...
2018-11-20 09:30:12
1254
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅