问题
Cross-browser handling is quite a hassle sometimes.
In this case I need to capture quite a number of events, but cannot afford to use a multi purpose library that exceeds 10ish Kb. (e.g. jQuery, Prototype, Dojo, YUI, ...)
The script is meant as a basic tracking tool for various sites I'm maintaining.
Every browser seems to handle events slightly and sometimes completely differently!
I would be really happy if someone could point me out to a Javascript library meant for cross-browser event handling.
This would make my day! =)
回答1:
Dean Edwards' : http://dean.edwards.name/weblog/2005/10/add-event2/
Or the one from John Resig: http://ejohn.org/blog/flexible-javascript-events/
回答2:
I'm not sure how much event handling you need to do or if you're looking to add custom events, but here's another option if you're feeling curious. It uses Dean Edwards and adds on some bells and whistles to come in around 5K minified.
https://github.com/fat/bean
来源:https://stackoverflow.com/questions/3317266/lightweight-library-for-cross-browser-event-support