kbwood gave you a solution. Did you try it? It will work, but probably
won't give you what you want!
Ajax is normally asynchronous. That means the script does not
wait for the reply before executing the next statement. When your:
$("#result1").html(mHTMLContent);
is executed, the
server has almost certainly not even gotten the request, let alone
having sent the response and the script received it! (Basic physics...)
Not only that, but
you make 5 requests in a loop. Most browsers will send most or all
of them all at once. (Or in very rapid succession) without first
waiting for a response. Your 5 responses will not necessarily
arrive in the order in which the requests were sent!
So, kbwood's
solution will "work", but will unnecessarily (but
benignly) re-write already received responses to the document. But
it may scramble the order of the content. The reason it works is
because he put the code that writes to the document INSIDE of the
callback function.
jQuery Ajax has a "synchronous" feature that you might be
tempted to use, but don't! Some browsers no longer permit
synchronous Ajax, and it's a bad practice anyway. More browsers
will stop supporting it in the future!
If at all possible, I would re-write your server code so that you
can get all of the data in a single response.
And then put your code that writes it to the document inside of the
callback, as kbwood has shown.