You can get an array of all the events that start with “on” (e.g. onclick) by running this in the Console of Firefox.
[i for(i in document)].filter(function(i){return i.substring(0,2)=='on'&&(document[i]==null||typeof document[i]=='function');})
You’ll get an array like this (Firefox 23):
["onreadystatechange", "onmouseenter", "onmouseleave", "onwheel", "oncopy", "oncut", "onpaste", "onbeforescriptexecute", "onafterscriptexecute", "onabort", "oncanplay", "oncanplaythrough", "onchange", "onclick", "oncontextmenu", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onloadeddata", "onloadedmetadata", "onloadstart", "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onpause", "onplay", "onplaying", "onprogress", "onratechange", "onreset", "onseeked", "onseeking", "onselect", "onshow", "onstalled", "onsubmit", "onsuspend", "ontimeupdate", "onvolumechange", "onwaiting", "onmozfullscreenchange", "onmozfullscreenerror", "onmozpointerlockchange", "onmozpointerlockerror", "onblur", "onerror", "onfocus", "onload", "onscroll"]
Firefox, because it supports array comprehension which that little snippet uses.
Too bad nobody uses firefox anymore.
Wrong, a lot of people are using Firefox! Chrome is to good, it will tell you that your site is perfect. When you’ll try it on IE all hell will break loose. On Firefox with developer toolbar and firebug you are all set! My friend uses Chrome to test his stuff and a lot of the times he does JS errors! Maybe if you are a normal user, Chrome it’s OK, if you are a web developer then I recommend Firefox.
Thanks :)
Cool…
and this code to be able to do cross-browser stuff… especially for “onwheel” event…