JAVASCRIPT技巧集锦

1、如何判断当前的浏览器是IE还是非IE。
var agt=navigator.userAgent.toLowerCase();
var is_ie=(agt.indexOf("msie")!=-1 && document.all);
if(is_ie)
{
}
else
{
}

2、attachEvent method
http://www.cnblogs.com/birdshome/archive/2005/04/11/109356.html
http://bbs.51js.com/viewthread.php?tid=45218&fpage=1&highlight=window.onload
 DOM提供的这个事件附加方式实际上是一个集合操作,我们可以多次的向同一个事件签名上attach多个事件处理函数,例如:
 window.attachEvent('onload', handler1);
 window.attachEvent('onload', handler2);
 window.attachEvent('onload', handler3);
 window.attachEvent('onload', handlerN);
原文地址:https://www.cnblogs.com/chenjunbiao/p/1760262.html