How to make Ajax call with JQuery

In this article am going to explain how to make ajax call with JQuery.

JQuery has $.ajax() method which is used to perform an asynchronous HTTP request.

The syntax of $.ajax() function is as follows

$.ajax(url[, options])

url is a string parameter that you want to reach with AJAX call while options is an object literal containing the configuration for the Ajax request.

JQuery AJAX example:

  url: "demo.txt",
  success: function(result){

JQuery AJAX post example:

  type: "POST",
  url: url,
  data: {name:"ranadheer",id:2},
  success: function(data, status,, jQxhr){
  error: function(jQxhr, textStatus){
  dataType: dataType

This way we can make AJAX calls with JQuery.

For more posts on JQuery visit: JQuery

No comments:

Post a comment