Problem with return $.post

Problem with return $.post

Hello:

I'm having a problem with return data from a $.post. Details follow below:

  • The $.post successfully sends data to a .php file.
  • The php file successfully processes the data and compiles results into an array. The array is returning in the console.log. When I return one value of the array (instead of the whole array), the value shows up in the console.log.
  • However, I can't get pull the values in the array into jQuery for use on my main page. In addition, I know something is off in my $.post routine because console.log and alert commands do not work within the routine.
  • I can not pass variable values outside the $.post, either. If I try to pass the variable value to $('#id').html(variable) - the value will not show up. But if I assign a test value to the global variable OUTSIDE of $.post, then it shows up in the $('#id').html().
  • However - once outside the $.post function - jQuery resumes normal activity.
  • All my variables are declared globally.
  • This file is "use strict";
  • Below is my $.post function

  1.            $.post("addressbk_data_3.php",{bind_topic:topic_array, bind_participants:rowOwner_array, bind_emails:email_array, bind_salutation:rowContact_array},function(data){
  2.                 var_returnData = $.parseJSON(data);
  3.                 var_postID = var_returnData.post_id;
  4.                 var_topicID = var_returnData.topic_id;
  5.                 var_emailCT = var_returnData.email_ct;
  6.                 alert("This is the email CT: " + var_emailCT); // This alert is NOT working. But jQuery below this function is continuing to operate as normal.
  7.            });
I am completely stumped and welcome any input others have.

Thanks Much:

Pavilion