听课 - Douglas Crockford Theory of the DOM

1. mosaic [mC'zeiik]


2.<script> <!--  code --></script>  兼容老式浏览器

    <script></script> 建议放在最后

     <style></style> 放在最前面


3. document.write 不建议使用,建议等页面加载后再修改


4.classic collections : document.frames 不建议使用


5. 标签name的作用


       5.1 取得 window frame


       5.2 把 radio bound 在一起


        5.3 用于向server传数据


6.document。all  avoid it


7.DOM tree ,ie 忽略空白  ,ff 有空白节点


8.tree 的递归编写 getElementsByClassName


9. 当前样式的获得


    9.1  ie : currentStyle


     9.2 w3c : document.defaultView().getcomputedStyles(node,"") ,java style


10.node.cloneNode(true)  深度copy


11. 两个节点的方法     insertBefore(new,silbling)  ,old.parentNode.replaceChild(new,old)


12 .removeNode()  时记得要把 事件监听器去除 ,否则 ie6 会内存泄露 ,结点循环引用了


13 innerHTML 不是标准 ,是事实都支持


14.event-model : single thread          e.target|| e.srcElement


15:  event capture :


trackling down : do not use it


bubbling up : 用容器内有很多子元素 只要要容易添加事件判断儿子即可。


16. cancel bubbling :


ie : e.returnvalue=false;

w3c: e.stopPropagation();


函数后返回 false; 组织浏览器的默认操作 .



17 : ie6 引用计数,判断循环引用,垃圾收集出错


 oneEl .onclick ={otherEl.do();}


otherEl.childe = oneEL;




18 : web page 与 web ajax application


web -page :page view-driven 一个页面几分钟而已


ajax : 一个页面几小时都不变


10 alert() 不建议使用 ,会 freeze 浏览器


11


      browser detection  , feature detection , platform detection


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值