Answers for "ajax fail"

6

ajax error

$.ajax({
    type: "post", url: "/SomeController/SomeAction",
    success: function (data, text) {
        //...
    },
    error: function (request, status, error) {
        alert(request.responseText);
    }
});
Posted by: Guest on October-14-2020
15

jquery ajax

$.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);

 });
Posted by: Guest on May-05-2020
-1

jquery ajax on fail

fail: function(xhr, textStatus, errorThrown){
	alert('request failed');
}
Posted by: Guest on October-05-2020
0

if( request()->ajax()==false

if ( !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' )
{
       # Ex. check the query and serve requested data
}
Posted by: Guest on March-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language