Need help handling multiple $.get calls :(

Need help handling multiple $.get calls :(

Hi. I'm new here and I'm very stuck. I need help. Hopefully someone can tell me there's a very simple solution to my problem

I have a site where you can click links and open the relevant content in a "window" so to speak. It's all from the same domain. Anyways, my problem occurs when you click on lets say... 5 links very fast. What happens is that only 1 or 2 of the windows get content. What's happening is that when one of the first calls finishes, it seems to take precedence over more recent calls.

Basically, I want to know how to handle multiple .get calls and load each one into a seperate window without interfering with the others. Here's the function that handles it:

popupWindow.prototype.openURL = function(link){
       windowname=this.windowname;
   theWindow="."+windowname+"_window .window .content";
   $(theWindow).hide();
        $(theWindow).html('<p class="page-loading"><img src="graphics/loading.gif" alt=""/></p>').fadeIn("medium");
      
   $.get(link, function(data) {
      $(theWindow).hide();
      $(theWindow).html(data).fadeIn("medium");
   });
}



The above code works just fine when you click on links... slowly. Or one at a time. If anyone can help, please let me know.