-1
What practice is recommended to check if jQuery’s Ajax function is present and is recognized by the browser, can anyone say?
// 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 website the condition for testing functions according to the form 1 and well used, at a glance:
https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX/Getting_Started
please give details to those who negatively!
– user78859