I'm getting the error Uncaught ReferenceError: GetLicenceUserList is not defined in the browser console when I call the function using $.ajax function inside.
But the call of my function works just fine when I call it with only an alert("example"); inside.
This are the code of both examples.
function GetLicenceUserList(id, actPage = 1, actualSearch = "", colOrder = 2, colDirec = "desc") {
alert(id + " - " + actPage + " - " + actualSearch + " - " + colOrder + " - " + colDirec);
/*$.ajax({
url: "/Licences/UserLicenceList",
type: "POST",
data: {
userId: id,
actPage = actPage,
actualSearch = actualSearch,
colOrder = colOrder,
colDirec = colDirec
}
}).done(function (result) {
$("#userLicence-list-card").html(result);
alert("ok");
}).fail(function () {
//operaciones en caso de falla
alert("fail");
});*/
}
This one works great, and the following is where the error occurs (when uncomment the ajax call):
function GetLicenceUserList(id, actPage = 1, actualSearch = "", colOrder = 2, colDirec = "desc") {
//alert(id + " - " + actPage + " - " + actualSearch + " - " + colOrder + " - " + colDirec);
$.ajax({
url: "/Licences/UserLicenceList",
type: "POST",
data: {
userId: id,
actPage = actPage,
actualSearch = actualSearch,
colOrder = colOrder,
colDirec = colDirec
}
}).done(function (result) {
$("#userLicence-list-card").html(result);
alert("ok");
}).fail(function () {
//operaciones en caso de falla
alert("fail");
});
}
key: valuepairs, notkey = valuepairs.