[thelist] AJAX: Generlizating Response Handling, RFC

Matt Warden mwarden at gmail.com
Mon May 16 21:02:49 CDT 2005


thelist,

On 5/16/05, Matt Warden <mwarden at gmail.com> wrote:
> However, at least in Firefox, this doesn't seem to be necessary. See
> my sandbox example:
> 
> http://mwarden.f2o.org/sandbox/ajax.htm
> 
> Type in a username and then move focus off of the field. Then replace
> focus and then remove it again, to get a second request. You'll notice
> that you get an alert notifying you of a nwely instantiated object
> only the first time, yet the request works fine both times.
> 
> It would be helpful if someone could confirm this behavior in IE as
> well. And, if someone has a Mac lying around, Safari would be nice to
> test, too.
...
> Interesting solution. My aim is to avoid creating an instance of
> XMLHttpRequest for every request, though. Of course, one might argue
> that if I am creating a new request, then I should be creating a new
> request object.

Actually, the more I think about t his, the less comfortable I am with
re-using XMLHttpRequest objects. Indeed, someone I've talked to said
it does not work well across browsers, but even if it did it simply
seems wrong.

I will still test it in other browsers if others don't have the
chance, and maybe do some speed comparisons. But it does seem unwise
to re-use the request objects, simply on principle.

Thoughts?

-- 
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.


More information about the thelist mailing list