I have a site that makes all page requests via AJAX.
I also have a comment form that will send the data via AJAX.

Now here it the problem. When you first go to the site there is NO
comment form anywhere in the DOM, then a user clicks on a story and I
sends off an AJAX request for that page and it returns some elements
than contain the form and are inserted (?) into in the DOM. (As far as
I remember, Mootools auto-refreshes the DOM on it's own.)

Ok, so I can't add a window.addEvent('domready', function() {}) to
scan for the form on page load - as the form won't show until the user
goes (via AJAX) to a page that has a comment form.

Now, I guess that I can set Mootools to intercept the form submit and
send it via AJAX after the AJAX call for the page completes - however,
what if the user submits the form and then goes to ANOTHER page with a
form and fills it out and tries to submit it? Will I end up with too
many instances of the form AJAX call? Will I start wasting objects? Or
will mootools reset the AJAX/form call each time DOM elements are
added?

Reply via email to