What about using an array of objects?&nbsp; Make the array global, and define each request locally so it goes out of scope...?&nbsp; Of course if the array is just a pointer, you could try defining each request initially AS an element in the array, e.g.&nbsp; aRequests[i] = new HttpRequest() (or whatever the syntax is for those things).<br><br>Cheers,<br><br>Peter<br><br><font face="Tahoma, Arial, Sans-Serif" size=2>
<hr align=center width="100%" SIZE=2>
<b>From</b>: "Murphy, Matt" <a href="mailto:Matt.Murphy@thermofisher.com">Matt.Murphy@thermofisher.com</a><br></font><br><br>My apologies on the reply...<br><br>Well, this seems to work if I use two different ajaxme scripts with two<br>different names of the httprequest object. <br><br>So the question is, is there a way to use variable variables like in PHP<br>to do this? <br><br>So I could name each instance of my httprequest object something<br>different? <br><br>Matt<br><br>-----Original Message-----<br>From: javascript-bounces@LaTech.edu<br><br><br><br>On Jul 25, 2007, at 10:42 AM, Murphy, Matt wrote:<br><br>&gt; All,<br>&gt;<br>&gt; I thought I had this ingenious idea, to make a slow-loading page load <br>&gt; faster, I'd break up the sections into divs, and then call a series of<br><br>&gt; ajax functions to populate those divs asynchronously.<br>&gt;<br>&gt; Problem is, only the last one called shows up. I can see in the <br>&gt; firefox error log that both document.getElementById <br>&gt; ('mydiv').innerHTML="myhtml"<br>&gt; calls ran, (the output of the php scripts called) but only one showed <br>&gt; up.<br><br>It's hard to know without looking at your ajaxme() function, but if both<br>calls are setting innerHTML on the same div, the last one to run is<br>overwriting all the others. It would be better to change that to<br>something like this (untested):<br><br>var newDiv = document.createElement( 'div' ); newDiv.innerHTML =<br>"myhtml"; document.getElementById('mydiv').appendChild( newDiv );<br>