First of all i am working in ASP.  And i have 3 elements i am trying
to populate.  I can do that no problem, but my issue is I am basically
making the same Ajax request 3 times and there is SQL involved that i
would rather only make once.

I have pseudo code below to represent what i am doing.  If i could
just make one call and pull topData, LeftData, and gridData that would
cut the processing down significantly.

$j.ajax({
          url: '/ajaxHandler.asp',
          data:  {handleSection:["top"],searchTerm:[''+searchTerm]},
          cache: false,
          complete: function(){
                  $j.ajax({
                  url: '/ajaxHandler.asp',
                  data:  {handleSection:["left"],searchTerm:[''+searchTerm]},
                  cache: false,
                  beforeSend: function(){
                  },
                  complete: function(){
                  },
                  success: function(html){
                          leftData = html;

                          $j.ajax({
                                  url: '/ajaxHandler.asp',
                                  data:  
{handleSection:["grid"],searchTerm:[''+searchTerm]},
                                  cache: false,
                                  beforeSend: function(){},
                                  complete: function(){
                                  },
                                  success: function(html){
                                        gridData = html;

                                       // populate sections
                                         $j("#top").html(topData);
                                         $j("#left").html(leftData);
                                         $j("#grid").html(gridData);
                                  }
                                });
                  }
                });
          },
          success: function(html){
                topData = html;
          }
        });

Reply via email to