我有一个带有 4 个参数的 JavaScript 函数
function GetEmpDetails(EmpID, ApplicationID, ActionID, ApplicationSubID)
{
$.ajax({
type: "POST",
url: '/TransController/GetEmpInformation',
data: { "EmpID": JSON.stringify(EmpID), "ApplicationID": ApplicationID, "ActionID": ActionID, "ApplicationSubID": ApplicationSubID },
dataType: "json",
beforeSend: function () {
},
success: function (data) {
DisplayDetails(data);
},
error: function (result) {
}
});
}
我想用一个不同的参数覆盖相同的函数。如下所示
function GetEmpDetails(EmpID, ApplicationID, ActionID, DateOfJoining)
{
$.ajax({
type: "POST",
url: '/TransController/GetEmpInformation',
data: { "EmpID": JSON.stringify(EmpID), "ApplicationID": ApplicationID, "ActionID": ActionID, "DateOfJoining": DateOfJoining},
dataType: "json",
beforeSend: function () {
},
success: function (data) {
DisplayDetails(data);
},
error: function (result) {
}
});
}
有人请告诉,是否有可能用一些示例代码来做以及如何做?