> Serialize is a great method to automatically prepare a form, but it > doesn't include the element that initiated the submit in the case > where I attach a click event to a <div> and call submit from the click > event. > > Is there a typical pattern to adding the submit element to the > serialized string so the server can know which element initiated? > > Does it matter what format it's in? ("submitter=elementId")? > > *bonus question* > This is academic but I'm trying to learn: why does ajax put data in a > querystring instead of using a form like normal html submit would do?
You could use the Form Plugin and its ajaxForm method if you want it to be handled for you. Otherwise it's up to you to append the submitting element's name and value to the data submitted. $.ajax does submit data the same way as a normal http submit. The query string is added to the url for GET requests and put in the body for POST requests. Mike