随笔分类 -  javascript

摘要:Expected Outcome When Using Classical Inheritance the goal of implementing classical inheritance is to have objects created by one constructor Child() get properties that come from another constructor Parent(). Here's an example of defining the two constructors Parent() and Child(): 阅读全文
posted @ 2011-03-27 18:58 来自非洲大草原的食人虎 阅读(384) 评论(2) 推荐(0)
摘要:在早期的互联网时期,Netscape和Microsoft考虑采用两种截然不同方式来驱动事件流。在Netscape模式中,事件流从document body一直向下回溯至事件源,称之为事件捕获。在Microsoft模式中,称之为事件冒泡,同事件捕获截元然相反,事件从事件源一直向上冒泡直至document对象,当某种类型的节点被点击时候document对象执行一个默认的行为。谢天谢地,W3C组织整合这两种模式,也就目前我们正在使用之中。 绝大部分时间你都会处理DOM事件,你将会担心事件冒泡。 阅读全文
posted @ 2011-03-15 18:07 来自非洲大草原的食人虎 阅读(536) 评论(0) 推荐(0)