What is the recommended practice to check if the jQuery Ajax function is present and recognized by the browser, does anyone know?
// forma 1
if (!$.ajax) {
alert ('Status xhr: não suporta Ajax');
return false;
}
// forma 2
if (typeof $.ajax !== 'function') {
alert ('Status xhr: não suporta Ajax');
return false;
}
In many of the examples on the Mozilla MDN site the condition for testing functions according to form 1 is well used,