javascript - 我想在 Jquery 中查看此 $.get() ajax 函数的源代码

标签 javascript jquery

我想查看函数 $.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/

相关文章:

javascript - Canvas 线条先变浅然后变暗

javascript - 需要使广告牌实体具有可选择的回调功能并且可能弹出信息

javascript - 避免 setTimeOut 循环多个实例

javascript - 自动填充文本框并模拟网页中的按钮单击

javascript - setInterval 计时器在移动设备上运行速度太快

javascript - JQueryUI : Place dialog box where mouse is clicked

javascript - 父宽度和高度区域中的轻量级可拖动锁

javascript - 检查 jquery 中的 404 错误状态

javascript - jQuery:选择所有不具有特定类的子元素

javascript - jquery选择器: how to select all li items from some index to the end?