php - When does an ajax request in jquery consider an http post request successful? -


here excerpt w3.org on http responses:

10.2 successful 2xx

this class of status code indicates client's request successfully received, understood, , accepted.

10.2.1 200 ok

the request has succeeded. information returned response dependent on method used in request, example:

get entity corresponding requested resource sent in response;

post entity describing or containing result of action;

is considered "received, understood, , accepted" when $_post[] variables stored in other variable?

edit: here ajax call calls empty php file.

$.ajax({     url: 'process.php',     data: 'type=new&title='+title+'&startdate='+start+'&zone='+zone,     type: 'post',     datatype: 'json',     success: function(response){                  event.id = response.eventid;                  $('#calendar').fullcalendar('updateevent',event);                 },     error:  function(e){                 alert('error processing request: '+e.responsetext);                 }   }); 

and calls error part of ajax call. console shows no errors. now why chooses error , not success ??

you don't need store anything... it's response code. example can make post "script" doesn't process anything, dummy empty file...

i don't understand what's "dilemma".


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -