.post a .post response

.post a .post response

Hey everyone.  I am pretty new to javascript and jquery and am looking for some help with the below code.  My problem seems to be on line 8 (the second .post).  My logs show that I am posting name as XMLHttpRespose.  However, if I alert(name), the correct value is alerted.

Could someone help me to 1, understand WHY this doesn't work and 2, get it working correctly?

Thanks,


   function load_tabs() {
    $.post("skins/new/includes/updateGroups.php?action=select", function(data) {
     saved_tabs = data.split(",");
     saved_tabs.pop();
     var x = saved_tabs.length;
     for (var i=0;i<x;i++){
      var name = saved_tabs[i];
      var mids = $.post("skins/new/includes/updateMonitors?action=select&groupName=", name); // name Posts as XMLHttpResponse
      $("#tabs").tabs('add', 'skins/new/views/monitors.php?mids='+mids, name);
     }
    });
   };