Coder Social home page Coder Social logo

blogs's Introduction

#目录 此为日常工作博客记录与备份,详细博客地址:http:blog.zhukejin.com

  1. PHP
  2. JAVASCRIPT
  3. CSS
  4. MYSQL
  5. Other
  1. 检测浏览器语言
  2. 多维数组排序
  3. 过滤用户输入
  4. PHP中JSON转义编码问题
  5. 常见对外接口token通讯验证手段
  6. PHP中短路符以及位运算符的研究
  7. 计算两个点是否在一个区域内
  8. 计算两个点的距离
  9. 通过外部接口获取IP所在地理位置
  10. 每天进步一点点
  11. 构建MVC-未完待续
  12. 对外API安全加密问题
  13. PHP->JAVA DES 加密对接
  14. php-curl-上传文件
  15. PHP截取中文字符串时候出现乱码问题
  1. 登陆框抖动
  2. 打印指定DIV
  3. Javascript判断浏览器及系统
  4. 关于 setTimeout() 方法的一些用法
  5. 你或许不需要jquery
  6. Javascript事件冒泡和捕获优先级的实验与探讨
  7. 使用 r.js 压缩Javascript代码
  8. Javascript 中this各种情况探讨
  9. 30个实用的Javascript库
  10. Javascript 继承封包
  11. HighChartError#19
  12. Javascript 变量作用域探讨
  13. Javascript 获取iframe父级url
  14. Javascript小技巧积累
  15. Angularjs option 默认问题
  16. Javascript 方法扩展
  17. Angularjs 隐藏方法整合
  18. React & Es6 学习笔记第一章(基本组件的创建)
  19. 模拟PHP- Array_pad 方法
  20. Vue配合Select2 实现的一个级联指令
  21. 通过 Range 选择并复制元素
  22. OverFlow引发的浏览器白屏
  1. 模态框弹出、懒加载等导致底层DOM跳动问题解决方案
  1. MYSQL时间函数整理
  1. 魔兽世界一部分LUA API

欢迎查漏补缺,纠正错误

blogs's People

Contributors

zhukejin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blogs's Issues

blogs/JAVASCRIPT/Javascript-event.md的另一观点

window (1) -> document (1) -> body (1) -> ul (1) -> li -> ul (2) -> body (2) -> document (2) -> window (2)

在浏览器支持addEventListener的前提下
addEventListener(ul, function(){}, true)
// 这里的ul, 是 ul(1)
addEventListener(ul, function(){}, false)
// 这里的ul, 是 ul(2)

我的看法,这样理解才更加正确

我的理解

捕捉是dom元素向后代下沉的过程,冒泡是相反,因此,捕捉和dom的加载顺序是一直的,在dom加载的过程中触发捕捉事件,而冒泡必须在加载完成后才会触发。这样理解就很好理解作者的实验项目了

事件流

事件传播三阶段:
1.capture phase (事件捕获)
2.target phase (处于目标)
3.bubbling phase (事件冒泡)
在 target phase,event handler 被调用的顺序不再遵循先捕获,后冒泡的原则,而是严格按照 event handler 注册的顺序,先注册,故而先执行。要改变二者的执行顺序,只需要改变两段源码的顺序即可。
W3C 规范:
Next, the implementation must determine the current target's candidate event listeners. This must be the list of all event listeners that have been registered on the current target in their order of registration. [HTML5] defines the ordering of listeners registered through event handler attributes. Once determined, the candidate event listeners must not be changed. Adding or removing listeners does not affect the current target's candidate event listeners.
https://stackoverflow.com/questions/18103391/usecapture-in-addeventlistener-behaves-strangely?lq=1
https://stackoverflow.com/questions/11841330/event-listeners-registered-for-capturing-phase-not-triggered-before-bubbling-w

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.