I have a textarea html element on my page that gets reloaded via ajax. The whole textarea is returned each time not just its content, and the content grows over time. Along
Instead of using the timeout, call that function on every AJAX response - provided you can tweak it.
That would free your browser from unnecessary timeouts.