Need Help With JQuery.deferred

Need Help With JQuery.deferred

Hello Everyone:

I hope this question is in the right forum. I'm using jQuery fullCalendar and having trouble with asynchronous execution preventing a proper refetchEvents. In research I found out about jQuery.deferred, but can't seem to properly execute a refetchEvents AFTER posting new events to the php file. Following is my script as it now stands:

  1.                 // Now that you've grabbed returned data from ol_LogEdits.php and created arrays, send the new arrays to ol_postActivity.php for INSERTing
  2.                 $.post("ol_postActivity2.php",{activityAry:extendArry, participantArry:extendParticipants},function(data){
  3.                 })
  4.                 .done(function (response) {
  5.                     //Our JSON response will come back with an http status of 200,
  6.                     // so we have to handle our errors in the "done" (success)
  7.                     // callback of the promise returned by post().
  8.                     if (response.error) {
  9.                         console.log("An error occurred");
  10.                     } else {
  11.                     $('#calendar').fullCalendar( 'refetchEvents' );
  12.                         console.log("Success!");
  13.                     }
  14.                 })
  15.                 .fail(function (response) {
  16.                     //This gets executed on failing http status codes (e.g. 400)
  17.                     console.log("A server error occured (failing http status code)");
  18.                 });

The console log is reporting "Success" from line 12. And I can see the calendar refresh, but the newly added events are not showing up on the calendar.

What am I doing wrong, the new data is INSERTING into the appropriate table, it's just that the calendar is not refetching it. I can only assume that it is because of asynchronous execution. So... why isn't the deferred taking care of the issue?

Thanks in Advance - Pavilion