AJAX form post

"hairbo" <[email protected]> 6 Nov 2006 13:03:31 -0800
Newsgroups gmane.comp.mozilla.devel.xml
Organization http://groups.google.com
Message-ID <[email protected]>
Apologies if this is the wrong forum for this question.

I have some AJAX code that currently just uses a "GET" method, like
this:

if (IE)
  req = new ActiveXObject("Microsoft.XMPHTTP");
else
  req = new XMLHttpRequest();

req.open("GET", url, true);
req.send();

...where "url" is the url with querystring params.

This works fine if I don't have to send all that much data along, but
I'd like to expand my code so that I can pass large blocks of data via
my AJAX code.

I've done a little digging online, but all I've found so far suggests
that doing FORM posts via XmlHttpRequest is just hideously ugly--you
have to loop over all elements on the page, then build out a key/value
string (just like a querystring), and then pass that as part of the
"send()" function.  All of the code I saw made it look just godawful.
Are there any good tutorials out there for this sort of thing?  Is it
really godawful to work with XmlHttpRequest and form posts?

Thanks in advance,
Ben Mueller