problem with asynchronous HTTP GET requests

problem with asynchronous HTTP GET requests

Hey to all! This is my first post here!
I have used this forum a lot of times for some problems that I had
with jQuery. Now it's time to make my first question :)) here it is:

I use the ajax library to make some asynchronous HTTP GET requests.
What I want to do is to make asynchronous requests with different inputs
and to integrate the results into the HTML whenever they'll come. Here is my code:

  1. var params=new Array();
  2. params[0]=2;
  3. params[1]="type_3";

  4. $.get('http://localhost/my_page_1.php', params, function(data) {
  5.       $('.result').html(data);
  6.       alert("the id of the request is " + params[0] + "and its type is " + params[1]);
  7. });

  8. params[0]=3;
  9. params[1]="type_7";



  10. $.get('http://localhost/my_page_2.php', params, function(data) {
  11.       $('.result').html(data);
  12.       alert("the id of the request is " + params[0] + "and its type is " + params[1]);
  13. });
The problem here is that finally these requests will output the same message:
      "the id of the request is 3 and its type is type_3".
But I want each request to happen based on its parameters that are set before,
so as the messages to be:
      "the id of the request is 2 and its type is type_3", for the 1st one and
      "the id of the request is 3 and its type is type_7", for the second one.

I want to do it with many more than two requests..

Can anyone help me to solve this problem?

Thank you in advance,
Thanasis