Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

ajax
jquery

What is AJAX success?

Sarvech Qadir

AJAX is a set of web development techniques that use many web technologies on the client-side to create asynchronous web applications.

  • With AJAX, web applications can asynchronously send and retrieve data from a server without interfering with the existing page’s display and behavior.
  • AJAX is not a programming language, and it requires a built-in browser with an XMLHttpRequest object that requests data from the server.
  • AJAX uses JavaScript and HTML DOM to display data.

AJAX success

Whenever an AJAX request successfully completes, jQuery triggers the ajaxSuccess event. All handlers that have been registered with the .ajaxSuccess() method are executed at this time. It is essentially a function to be run when the request succeeds.

success(result,status,xhr)	

Example

To use .ajaxSuccess() a demo or test file is required.

For example, in the output below, we want to change the heading. When we click on the button, it will change the output of the document. We will define our relevant content in the test file, test_file.txt. Upon success, the content is replaced with the content of our test file.

// test_file.txt
<h2> Hello world </h2>
<p> Today is Monday. </p>

RELATED TAGS

ajax
jquery

CONTRIBUTOR

Sarvech Qadir
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring