Course Content

  • 9.3ajaxSend
  • 9.3 ajaxError

Course Content


  • Method: ajaxError() in jQuery
  • When an AJAX request fails, the ajaxError() method defines a function to run.

When an AJAX request is about to be made, the ajaxSend() method provides a function to perform.

Sending a header through the Ajax request anywhere in the 400's is the easiest approach to bubble that error from the server side (using php) to the client side (which is always associated with errors). When the Ajax request receives this, your error function is called.

The ajaxSend() method is used to send an XMLHttpRequest to the server. It can be used in the following ways:

  • To send data from the browser to the server
  • To make an AJAX call using JavaScript
  • To make an AJAX call using jQuery

The client side code for this function is as follows:

  • var xhr = new XMLHttpRequest();
  •"POST", "");
  • xhr.send(data);

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere