Skip to content

Commit dabc1fe

Browse files
author
zhangyonghong
committed
add return false
1 parent 5d04cd7 commit dabc1fe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

js.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
Math.random()*(n-m)+m
77
```
88

9+
- [return false](http://stackoverflow.com/questions/1357118/event-preventdefault-vs-return-false)
10+
```javascript
11+
// event.preventDefault()会阻挡预设要发生的事件.
12+
// event.stopPropagation()会阻挡发生冒泡事件.
13+
// 而return false则是前面两者的事情他都会做:
14+
// 他会做event.preventDefault();
15+
// 他会做event.stopPropagation();
16+
// 停止callback function的执行并且立即return回来
17+
```
18+
919
#### 2. [微信 weixin](http://loo2k.com/blog/detecting-wechat-client/)
1020

1121
- UserAgent 判断微信客户端

0 commit comments

Comments
 (0)