Answers for "jquery ajax status code"

0

how to get the status of other urls in ajax

$('#main-menu a').on('click', function(event) {
  event.preventDefault();

  $.ajax(this.href, {
    success: function(data) {
      $('#main').html($(data).find('#main *'));
      $('#notification-bar').text('The page has been successfully loaded');
},
    error: function() {
      $('#notification-bar').text('An error occurred');
    }
  });
});
Posted by: Guest on May-26-2020
-1

jquery ajax on fail

fail: function(xhr, textStatus, errorThrown){
	alert('request failed');
}
Posted by: Guest on October-05-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language