If load is called with two arguments or more, jQuery checks to see if the second argument is a function or an object. If it's a function it's called when the ajax call is completed. Otherwise it's used as the params passed with the ajax call.
Relevant parts from the source:
if ( params ) {
// If it's a function
if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = null;
// Otherwise, build a param string
} else if ( typeof params === "object" ) {
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
type = "POST";
}
}
Where params is the second argument to load.
isFunction is the result of the following functions:
isFunction: function( obj ) {
return jQuery.type(obj) === "function";
},
type: function( obj ) {
return obj == null ?
String( obj ) :
class2type[ toString.call(obj) ] || "object";
},
where class2type is an assosiative array containing, among other things, this element:
class2type[ "[object Function]" ] = "function";
dataparameter should not be a function, and inspects the type of the argument. If it is a function, then it assumes that it must be the completion handler, because that is the only parameter that should be a function.