Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 402 Bytes

send-an-ajax-request.md

File metadata and controls

18 lines (16 loc) · 402 Bytes

How to send an Ajax request in jQuery

This is a boilerplate to be used for sending Ajax requests

$.ajax({
  url: "http://google.com",
  type: "post",
  dataType: "json",
  data: {name: item, value: value},
  success: function (response) {
    // do somethinig here
  },
  error: function(jqXHR, textStatus, errorThrown) {
    console.log(textStatus, errorThrown);
  }
});