我想查看函数 $.get() 的源代码 This one
我该如何继续这样做,我下载了 Jquery 1.7 开发人员版本,但无论如何都无法在其中找到此功能...
最佳答案
这些是 $.ajax 函数的别名。查看此文件中的第 7150 行
http://code.jquery.com/jquery-1.7.js
jQuery.each( [ "get", "post" ], function( i, method ) {
jQuery[ method ] = function( url, data, callback, type ) {
// shift arguments if data argument was omitted
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = undefined;
}
return jQuery.ajax({
type: method,
url: url,
data: data,
success: callback,
dataType: type
});
};
});
关于javascript - 我想在 Jquery 中查看此 $.get() ajax 函数的源代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8495682/