I'm trying to find a way to add a listener to an object such as a <div>.

I have a <div> whose content is populated via AJAX. In this particular scenario, the height of said <div> has to be hard-coded. In some instances, the amount of vertical space required to display the data returned by AJAX exceeds the height of this <div> and therefore gets cut off.

I am looking for a way to have JavaScript detect that the data is being cut off and adjust the height of the containing <div> accordingly.

Unfortunately the code that parses and populates the data returned by AJAX is part of the .NET AJAX framework so I have no control over what happens during that process.

My only thought was to add a listener to some object that could then trigger a function to adjust the height of the <div>. Is there any event that I can listen for on that <div> that will fire when the content is populated?

Or if I'm going about this bass-ackwards, any other suggestions (outside of not hard-coding the height of the <div>) are welcomed.