摘要:
在写跨浏览器的js程序中,检测浏览器是一个很重要的工作。我们不时要为不同的浏览器写分支代码。如下是一种//添加事件工具函数function addEvent(el,type,handle){ if(el.addEventListener){//for standard browses el.addEventListener(type,handle,false); }else if(el.attachEvent){//for IE el.attachEvent("on"+event,handle); }else{//other el["... 阅读全文
posted @ 2011-08-24 21:52
likebeta
阅读(899)
评论(0)
推荐(0)

浙公网安备 33010602011771号