ajax error

JavaScript
$.ajax({
    type: "post", url: "/SomeController/SomeAction",
    success: function (data, text) {
        //...
    },
    error: function (request, status, error) {
        alert(request.responseText);
    }
});
   	$.ajax({
       url : 'more_com.php', //PHP file to execute
       type : 'GET', //method used POST or GET
       data : {variable1 : "some data"}, // Parameters passed to the PHP file
       success : function(result){ // Has to be there !
           
       },

       error : function(result, statut, error){ // Handle errors

       }

    });

// NOTE : Parameters will be available either through $_GET or $_POST according
// to the method you choosed to use. 
// Here you will get your variable "variable1" this way : $_GET['variable1'] $.ajax({

   url     : "file.php",
   method  : "POST",

       data: { 

         //key                      :   value 
         action                   	:   action , 
         key_1   					:   value_key_1,
         key_2   					:   value_key_2
       }
   })

   .fail(function() { return false; })

	// Appel OK
   .done(function(data) {

   console.log(data);

 });fail: function(xhr, textStatus, errorThrown){
	alert('request failed');
}
Source

Also in JavaScript: