I'm attempting to create an AJAX request. Here's my function definition:
function AJAXrequest(url, postedData, callback) {
$.ajax({
type: 'POST',
url: url,
data: postedData,
dataType: 'json',
success: callback
});
}
Here's where I call it, providing the parameters:
AJAXrequest('voting.ajax.php', data, function(data) {
// function body
});
Yet the callback does not run, and instead I get a console.error
:
TypeError: $.ajax(...) is not a function.
Why?
tag, Delete that
– Eranda J. Jun 26 '23 at 06:48