根据jQuery load()方法api:
.load( url [, data] [, complete(responseText, textStatus, XMLHttpRequest)] )
Run Code Online (Sandbox Code Playgroud)
通过下面的工作示例
$('#result').load('ajax/test.html', function() {
alert('Load was performed.');
});
Run Code Online (Sandbox Code Playgroud)
它提供'url'和'callback function'的参数,跳过[data]参数.
示例代码不应该将回调函数视为[data]参数(第二个参数)吗?由于API中定义的参数的顺序.通过遵循API,第一个是url,第二个是数据,第三个是回调.
我不明白为什么代码会起作用.非常困惑.
它非常清楚地写在jQuery源代码中.
https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js
搜索 load: function( url, params, callback )
它检查params(第二个参数),如果存在,它将调用isFunction内部检查参数类型的方法,如果它是一个函数则返回true.其余的你知道....

这是怎么isFunction样的
