Thread:Talk:ResourceLoader/JavaScript Deprecations/killEvt()/reply (2)

The name of the event object is different per browser and the way to stop the default action (ie. following a link) is also different per browser. However jQuery takes care of this since it maps it all to event.preventDefault. Meaning something like the following works in all browsers (IE 6.0+, FF 2+, Safari 3.0+, Opera 9.0+, Chrome) Also, don't use  unless there is a specific reason you want to do that. It stops other handlers from being triggered and has other downsides. Use e.preventDefault when all you want is stopping the browser from doing it's own thing.

wikibit's killEvt was a (fairly complete) function that takes care of a lot of variations in different browsers but does exactly what e.preventDefault does in jQuery it is therefor redundant and not ported to the new ResourceLoader code, since jQuery is now available on all pages by default.

Also I'd like to emphasize here that wikibits and the new mw resources are not mutually exclusive. There will be a period of time in which both are available (read also the intro paragraph on ResourceLoader/JavaScript Deprecations). Krinkle 13:07, 11 December 2010 (UTC)