Using JQuery, we can simply make Ajax call. JQuery provides us simple methods to make Ajax call using GET or POST. We can use any of these HTTP methods to make Ajax request using JQuery.

1. $.get() : Load a remote page using an HTTP GET request.

Syntax: $.get(String url, Map params, Function callback) returns XMLHttpRequest

Example 1: simple ajax call using $.get()

$.get(“test.php”);

Example 2: ajax call with parameter in query string

$.get(“test.php”, { name: “mohit”, age: “24″ } );

Example 3: ajax call handles response

$.get(“test.php”, function(data){
alert(“Ajax call complete”);
});

Example 4: ajax call with parameter in query string and handles response

$.get(“test.php”,
{ name: “mohit”, age: “24″ },
function(data){
alert(“Ajax call complete”);
}
);

2. $.post() : Load a remote page using an HTTP POST request.

Syntax: $.post(String url, Map params, Function callback) returns XMLHttpRequest

Example 1: simple ajax call using $.post()

$.post(“test.php”);

Example 2: ajax call with parameter

$.post(“test.php”, { name: “mohit”, age: “24″ } );

Example 3: ajax call handles response

$.post(“test.php”, function(data){
alert(“Ajax call complete”);
});

Example 4: ajax call with parameter and handles response

$.post(“test.php”,
{ name: “mohit”, age: “24″ },
function(data){
alert(“Ajax call complete”);
}
);

Isn’t it simple to use JQuery for AJAX…