element.on<eventname>, e.g. element.onmouseove = function(e){};Netscape’s traditional event registration model, universally supported (i.e. cross-browser compatible), big drawback = only one event handler can be registered. Therefore when multiple handlers are required a wrapping function must be created.element.attachEvent, Microsoft’s solution to the big drawback of Netscape’s traditional model.element.addEventListener, W3C’s solution and therefore the standard.http://www.quirksmode.org/js/events_tradmod.htmlhttp://www.quirksmode.org/js/events_advanced.html
Line 2361 – jQuery.each(["bind", "one"], function( i, name ) { ...jQuery.fn[ name ] = function( type, data, fn ) { ... jQuery.event.add( this[i], type, handler, data ); ... }; ...});Line 1555 –jQuery.event = { // Bind an event to an element add: function( elem, types, handler, data ) { ... // Bind the global event handler to the elementif ( elem.addEventListener ) {elem.addEventListener( type, eventHandle, false );} else if ( elem.attachEvent ) {elem.attachEvent( "on" + type, eventHandle );} ... }; ...};
AjQuery object is commonly made using a CSS selector, e.g. $(“#menu > li”) equates to “select all <li>’s that are a direct child of the element with id ‘menu’”, http://www.w3.org/TR/CSS2/selector.html.In which direction would a browser read a CSS selector such as “#menu > li”?Rightmost first! Therefore “#menu > li” will actually find every li element on the page and then check to see if it is a direct descendant of the element with id ‘menu’.css.selectors.htm will match 6 li elements before using the child rule to limit the result set down to 3 li elements.http://www.stevesouders.com/blog/2009/06/18/simplifying-css-selectors/https://developer.mozilla.org/en/Writing_Efficient_CSS