我有类似的功能
function someFunc(somevar) {
somevar = typeof(somevar) != 'undefined' ? somevar : 1;
$.ajax({
    url: 'index.php',
    type: 'post',
    data: 'somevar=' + somevar,
    dataType: 'json',
    success: function(json) {
            // smth
        }   
    }
});
}
我想将 $.ajax 函数作为对象,所以我可以编辑它。欢迎任何建议