valentincognito
11/2/2016 - 2:03 AM

Ajax Requests

Ajax Requests

$.ajax({
  type: 'post',
  dataType: 'json',
  url: 'url',
  data: {
    data1:  data1,
    data2:  data2
    },
  success: function (data) {
      console.log(data);
  },
      error: function (request, status, error) {
      console.log('code: '+request.status+"\n"+'message: '+request.responseText+"\n"+'error: '+error);
  }
});