JQuery Programmer Question: Download JQuery Programmer PDF

What are the various ajax functions?

Tweet Share WhatsApp

Answer:

Ajax allows the user to exchange data with a server and update parts of a page without reloading the entire page. Some of the functions of ajax are as follows:

1. $.ajax() : This is considered to be the most low level and basic of functions. It is used to send requests . This function can be performed without a selector.
2. $.ajaxSetup() : This function is used to define and set the options for various ajax calls.
For ex.
$.ajaxSetup({
"type":"POST",
"url":"ajax.php",
"success":function(data)
{
$("#bar")
.css("background","yellow")
.html(data);
}
});

3. Shorthand ajax methods : They comprise of simply the wrapper function that call $.ajax() with certain parameters already set.
4. $.getJSON() : This is a special type of shorthand function which is used to accept the url to which the requests are sent. Also optional data and optional callback functions are possible in such functions.

Download JQuery Programmer PDF Read All 201 JQuery Programmer Questions
Previous QuestionNext Question
Can we execute/run multiple Ajax request simultaneously in jQuery? If yes, then how?What is jQuery.holdReady() function?