JQuery Full calendar: how to update the calendar after the end of an ajax call?

eventDrop: function(event, dayDelta, revertAction) { $.post("/calendar/",{id: event.id } , function(result) { if (result == "succeed"){ alert('succeed'); } else{ alert("Server error, Please try again"); } },"json"); } 

So, in this method, I have an ajax call. I want the calendar to be updated only upon a successful return from the server, otherwise it does nothing. How is such code written?

+4
source share
2 answers
+2
source
 $.post("/calendar/", {id: event.id }, function (data, textStatus, XMLHttpRequest) { // use data if textStatus == 200 }, "json" ); 

?? see jQuery.post () documentation

0
source

Source: https://habr.com/ru/post/1336738/


All Articles