Can someone explain this code please

Can someone explain this code please

This is a followup to my last post. 


If either is answered I will end the other.

As a jQuery/Ajax/tablesorter novice, I was hoping someone could explain what this code is actually doing (rather than me continuing to go on my assumptions). It seems to me, if I am seeing this correctly, that the developer began with too much happening. 

I see the following happening:
1 - The campaign_array is getting loaded
2 - The $.ajax call on line 10 is happening
3 - The call to get _campaign_summary works, and the desired information is returned
4 - I can see the info required for the table in data through the console log - line 16
5 - Lines 17-19 seem to be calling get_campaign_summary again. This time the campaign_array parameter is empty so, as it should, my page does not show the table. (I can see this in a log file I write to in get_campaign_summary)

So, if what he wants is for the table to reload with the data retrieved by get_campaign_summary, what needs to come out (an assumption because of the two calls to get_campaign_summary) and what needs to change?
  1. $("form").on("submit", function(e){
  2. e.preventDefault();
  3. campaign_array = multi_list.campaign_list.multiselect("getChecked").map(function(){
  4.     return this.value;    
  5. }).get();
  6. console.log('Campaign Array: ', campaign_array);

  7. var ajaxObj = $.ajax({
  8. url : VALIDATION_URL + '?operation=get_campaign_summary&campaign_array=' + campaign_array,
  9.             type    : $(this).attr('method'),
  10.             dataType: 'json',
  11.             data    : $(this).serialize(),
  12.             success : function( data,html ) {
  13.                         console.log('Submitted: ', data);
  14.                   campaign_summary.table
  15.                    .html(html)
  16.                   .trigger("updateAll",[resort]);
  17.                       },
  18.             error   : function( data, xhr, err ) {
  19.                         console.log('Oops: ', data, xhr , err);
  20.                       }
  21.         }); 
  22. console.log('ajaxObj: ', ajaxObj);
  23. return false;
  24. });