Fixed #1781 for warnings created on load by FF javascript.options.strict == true.

This commit is contained in:
David Serduke 2007-12-16 01:03:50 +00:00
parent 4e339ef557
commit feb9051c0e
5 changed files with 43 additions and 36 deletions

View file

@ -246,7 +246,7 @@ jQuery.extend({
head.appendChild(script); head.appendChild(script);
// We handle everything using the script element injection // We handle everything using the script element injection
return; return undefined;
} }
var requestDone = false; var requestDone = false;
@ -362,9 +362,6 @@ jQuery.extend({
if ( !s.async ) if ( !s.async )
onreadystatechange(); onreadystatechange();
// return XMLHttpRequest to allow aborting the request etc.
return xml;
function success(){ function success(){
// If a local callback was specified, fire it and pass it the data // If a local callback was specified, fire it and pass it the data
if ( s.success ) if ( s.success )
@ -388,6 +385,9 @@ jQuery.extend({
if ( s.global && ! --jQuery.active ) if ( s.global && ! --jQuery.active )
jQuery.event.trigger( "ajaxStop" ); jQuery.event.trigger( "ajaxStop" );
} }
// return XMLHttpRequest to allow aborting the request etc.
return xml;
}, },
handleError: function( s, xml, status, e ) { handleError: function( s, xml, status, e ) {

View file

@ -418,7 +418,8 @@ jQuery.fn = jQuery.prototype = {
} }
} else }
return this.each(function(){ return this.each(function(){
if ( this.nodeType != 1 ) if ( this.nodeType != 1 )
return; return;
@ -971,9 +972,9 @@ jQuery.extend({
div.childNodes : div.childNodes :
[]; [];
for ( var i = tbody.length - 1; i >= 0 ; --i ) for ( var j = tbody.length - 1; j >= 0 ; --j )
if ( jQuery.nodeName( tbody[ i ], "tbody" ) && !tbody[ i ].childNodes.length ) if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
tbody[ i ].parentNode.removeChild( tbody[ i ] ); tbody[ j ].parentNode.removeChild( tbody[ j ] );
// IE completely kills leading whitespace when innerHTML is used // IE completely kills leading whitespace when innerHTML is used
if ( /^\s/.test( elem ) ) if ( /^\s/.test( elem ) )

View file

@ -170,7 +170,7 @@ jQuery.event = {
} else { } else {
// don't do events on text and comment nodes // don't do events on text and comment nodes
if ( element.nodeType == 3 || element.nodeType == 8 ) if ( element.nodeType == 3 || element.nodeType == 8 )
return; return undefined;
var val, ret, fn = jQuery.isFunction( element[ type ] || null ), var val, ret, fn = jQuery.isFunction( element[ type ] || null ),
// Check to see if we need to provide a fake event, or not // Check to see if we need to provide a fake event, or not
@ -339,7 +339,8 @@ jQuery.event = {
if ( jQuery.browser.msie || document.readyState != "loaded" && document.readyState != "complete" ) if ( jQuery.browser.msie || document.readyState != "loaded" && document.readyState != "complete" )
document.documentElement.doScroll("left"); document.documentElement.doScroll("left");
} catch( error ) { } catch( error ) {
return setTimeout( arguments.callee, 0 ); setTimeout( arguments.callee, 0 );
return;
} }
// and execute any waiting functions // and execute any waiting functions
@ -367,17 +368,19 @@ jQuery.event = {
setup: function() { setup: function() {
if (jQuery.browser.msie) return false; if (jQuery.browser.msie) return false;
jQuery(this).bind('mouseover', jQuery.event.special.mouseenter.handler); jQuery(this).bind('mouseover', jQuery.event.special.mouseenter.handler);
return true;
}, },
teardown: function() { teardown: function() {
if (jQuery.browser.msie) return false; if (jQuery.browser.msie) return false;
jQuery(this).unbind('mouseover', jQuery.event.special.mouseenter.handler); jQuery(this).unbind('mouseover', jQuery.event.special.mouseenter.handler);
return true;
}, },
handler: function(event) { handler: function(event) {
var args = Array.prototype.slice.call( arguments, 1 ); var args = Array.prototype.slice.call( arguments, 1 );
// If we actually just moused on to a sub-element, ignore it // If we actually just moused on to a sub-element, ignore it
if ( withinElement(event, this) ) return; if ( withinElement(event, this) ) return true;
// Execute the right handlers by setting the event type to mouseenter // Execute the right handlers by setting the event type to mouseenter
event.type = 'mouseenter'; event.type = 'mouseenter';
// Include the event object as the first argument // Include the event object as the first argument
@ -391,17 +394,19 @@ jQuery.event = {
setup: function() { setup: function() {
if (jQuery.browser.msie) return false; if (jQuery.browser.msie) return false;
jQuery(this).bind('mouseout', jQuery.event.special.mouseleave.handler); jQuery(this).bind('mouseout', jQuery.event.special.mouseleave.handler);
return true;
}, },
teardown: function() { teardown: function() {
if (jQuery.browser.msie) return false; if (jQuery.browser.msie) return false;
jQuery(this).unbind('mouseout', jQuery.event.special.mouseleave.handler); jQuery(this).unbind('mouseout', jQuery.event.special.mouseleave.handler);
return true;
}, },
handler: function(event) { handler: function(event) {
var args = Array.prototype.slice.call( arguments, 1 ); var args = Array.prototype.slice.call( arguments, 1 );
// If we actually just moused on to a sub-element, ignore it // If we actually just moused on to a sub-element, ignore it
if ( withinElement(event, this) ) return false; if ( withinElement(event, this) ) return true;
// Execute the right handlers by setting the event type to mouseleave // Execute the right handlers by setting the event type to mouseleave
event.type = 'mouseleave'; event.type = 'mouseleave';
// Include the event object as the first argument // Include the event object as the first argument
@ -444,6 +449,7 @@ jQuery.fn.extend({
triggerHandler: function( type, data, fn ) { triggerHandler: function( type, data, fn ) {
if ( this[0] ) if ( this[0] )
return jQuery.event.trigger( type, data, this[0], false, fn ); return jQuery.event.trigger( type, data, this[0], false, fn );
return undefined;
}, },
toggle: function() { toggle: function() {

View file

@ -181,7 +181,7 @@ jQuery.fn.extend({
var queue = function( elem, type, array ) { var queue = function( elem, type, array ) {
if ( !elem ) if ( !elem )
return; return undefined;
type = type || "fx"; type = type || "fx";

View file

@ -85,8 +85,6 @@ jQuery.fn.offset = function() {
results = { top: top, left: left }; results = { top: top, left: left };
} }
return results;
function border(elem) { function border(elem) {
add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") ); add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") );
} }
@ -95,4 +93,6 @@ jQuery.fn.offset = function() {
left += parseInt(l) || 0; left += parseInt(l) || 0;
top += parseInt(t) || 0; top += parseInt(t) || 0;
} }
return results;
}; };