The
GetDetails
function is marked as
async
; the AJAX success callback function is not.
Rather than using a callback function, you can simply
await
the
$.ajax
function:
async function GetDetails(id) {
var data = await $.ajax({
url: "/url",
data: { id: id },
dataType: "json",
type: "GET"
});
}