I keep getting an Uncaught TypeError: $.ajax is not a function but I’m not sure why. I’m not using the slim jQuery and can’t see why I’ getting the error.
Does anybody have any suggestions?
This is the code I’m using:
function makeCall(){
var newId = (new Date()).valueOf();
var dataLive = {
newId: newId,
ajax: $.ajax({
data: options,
dataType: 'json',
method: 'POST',
url: thisInstance.url
}).done(function(data) {
if ( thisInstance.activeAjaxHandle. newId !== newId ){
return;
}
thisInstance.activeAjaxHandle = {};
callback(data);
})
};
return dataLive;
}
So, it turns out that @m3g4p0p was pretty spot on - looking through the HTML for your page, you’re loading jQuery 2.2.4 and some plugins from the jsdelivr CDN. Then, in the footer of the page, you’re loading jQuery 3.2.1 Slim from the jQuery CDN… this second version will be replacing the first and knocking out the ajax stuff (among other things).
Thank you, I hadn’t realised that was there. I think when I first starting to use Bootstrap I must have added it but as it got more advanced I added the other jQuery.