X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=inline;f=src%2Fjquery%2Fjquery.js;h=8a0a115c40935ebcf52465b55ae92e860dd8b6b4;hb=8f1e0ef25370c1b7f959355c385e76325272b4f6;hp=8cffb8e876ddbb4e7e46f0203c011c0e977936cb;hpb=42785b1c1dbdb51e798de90720a164731f495e44;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 8cffb8e..8a0a115 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -162,6 +162,8 @@ var $ = jQuery; * technically, chainable - there really isn't much use for chaining against it. * You can have as many $(document).ready events on your page as you like. * + * See ready(Function) for details about the ready event. + * * @example $(function(){ * // Document is ready * }); @@ -1958,9 +1960,6 @@ jQuery.extend({ event = jQuery.event.fix( event || window.event || {} ); // Empty object is for triggered events with no data - // If no correct event was found, fail - if ( !event ) return false; - var returnValue = true; var c = this.events[event.type]; @@ -1983,20 +1982,19 @@ jQuery.extend({ }, fix: function(event) { - // check IE - if(jQuery.browser.msie) { - // fix target property, if available - // check prevents overwriting of fake target coming from trigger - if(event.srcElement) - event.target = event.srcElement; - - // calculate pageX/Y + // fix target property, if available + if(event.srcElement) + event.target = event.srcElement; + + // calculate pageX/Y if missing + if(typeof event.pageX == "undefined") { var e = document.documentElement, b = document.body; event.pageX = event.clientX + (e.scrollLeft || b.scrollLeft); event.pageY = event.clientY + (e.scrollTop || b.scrollTop); + } - // check safari and if target is a textnode - } else if(jQuery.browser.safari && event.target.nodeType == 3) { + // check if target is a textnode (only for safari) + if(jQuery.browser.safari && event.target.nodeType == 3) { // target is readonly, clone the event object event = jQuery.extend({}, event); // get parentnode from textnode @@ -2004,15 +2002,17 @@ jQuery.extend({ } // fix preventDefault and stopPropagation - if (!event.preventDefault) + if (!event.preventDefault) { event.preventDefault = function() { this.returnValue = false; }; + } - if (!event.stopPropagation) + if (!event.stopPropagation) { event.stopPropagation = function() { this.cancelBubble = true; }; + } return event; } @@ -2461,6 +2461,9 @@ jQuery.macros = { /** * Get the html contents of the first matched element. * + * A wrapper for the innerHTML property of DOM elements, therefore + * not available for XML documents. + * * @example $("div").html(); * @before
* @result @@ -2473,6 +2476,9 @@ jQuery.macros = { /** * Set the html contents of every matched element. * + * A wrapper for the innerHTML property of DOM elements, therefore + * not available for XML documents. + * * @example $("div").html("new stuff"); * @before * @result