when you use () that means to execute the code right here and now. You want to assign the reference to the function to the evet handler.
Since you are using a global variable to hold the xmlHttpRequest Object, you should use a global variable for the containerId.
Also the code should be
It gets around some browser bugs.