title: Javascript variable does not update via ajax
body: <p>I believe I haven't fully grasped variable scope in jQuery and need some help to understand why the variable "final_shasign" comes out fine inside the AJAX but is undefined outside the AJAX despite it being declared outside of the AJAX.</p>
  
  <pre><code>var final_shasign; // initial declaration outside of ajax block below
  
  $.ajax({
      type: "POST",
      url: "sha.php",
      data: "amount="+amount+"&amp;cn="+cn+"&amp;currency="+currency+"&amp;language="+language+"&amp;orderid="+orderid+"&amp;pspid="+pspid,
      success: function(response_data, final_shasign){
          var parsed_data = $.parseJSON(response_data);
          final_shasign = parsed_data.shasign;
          console.log ("inside nested ajax: " + final_shasign); //comes out fine
      }
  });
  
  console.log ("outside of nested ajax: " + final_shasign); //comes out as undefined!
  </code></pre>