It would be more useful if it were part of a toolkit like Dojo or jQuery, and would automatically happen when you use their AJAX functions.