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 c开发者_JAVA百科alendar to only be updated when success is returned from the server, otherwise it does nothing. How is this kind of code written?
http://arshaw.com/fullcalendar/docs/event_rendering/rerenderEvents/
.fullCalendar( 'rerenderEvents' )
$.post("/calendar/", {id: event.id },
function (data, textStatus, XMLHttpRequest) {
// use data if textStatus == 200
},
"json"
);
?? see jQuery.post() documentation
精彩评论