摘要:
借用jQuery对浏览器的强用力的正则表达式判断,扩展下(function(){functionuaMatch(ua){ua=ua.toLowerCase();varmatch=/(webkit)[\/]([\w.]+)/.exec(ua)||/(opera)(?:.*version)?[\/]([\w.]+)/.exec(ua)||/(msie)([\w.]+)/.exec(ua)||!/compatible/.test(ua)&&/(mozilla)(?:.*?rv:([\w.]+))?/.exec(ua)||[];return{browser:match[1]||&quo 阅读全文
posted @ 2011-08-23 17:20
逆天寒
阅读(190)
评论(0)
推荐(0)
摘要:
我们在往页面元素添加事件处理的时候,一般有如下二种方式:IE中 elm.attachEvent, FF系列elm.addEventLister直接绑定elm.onclick当我们往同一个元素多次注册事件处理函数时,顺序是很有意思的<html><head><title>Event注册</title></head><body><inputtype="button"id="bt"value="click"/></body><scriptty 阅读全文
posted @ 2011-08-23 17:09
逆天寒
阅读(577)
评论(0)
推荐(1)