I'm very much intrigued by your work to use IFRAMES instead of xmlhttprequest. Is your work available for download. I'm especially interested to see what kind of polling mechanism you've used. Or are updates simply event triggered? I'd also like to see what sort of error handling you may have come up with.

This was a very interesting read, so I'm glad you and everyone else has been sharing their thoughts!

It comes with an example that script test_ajax_form.php that demonstrates how it works.

You add an AJAX submit input to the form like any other input, except that the plug-in takes care of generating the necessary JavaScript and HTML for the hidden IFrame to process all client-server interaction.

The example shows how to connect a click event on a submit button to the AJAX form submit action. However, you could trigger the AJAX form submission with any other event on any input, or even execute the necessary JavaScript code generated by the plug-in to submit the form without attaching to an event.

The plug-in changes the target of the form to the IFrame before submitting the form.

Once the form is submitted, the code generated by the plug-in registers a timeout handling function that keeps polling a local JavaScript variable until the response comes.

On the server side, the plug-in intercepts the AJAX request and posts a message in a queue of the PHP forms class object. The applications must get the messages in the queue and respond to tell the plug-in what to send to the browser as AJAX response.

Several actions may be executed, like inserting or replacing some HTML, redirect the browser to a new page, wait for a while, etc..

If for some reason the response from the server does not come up, the JavaScript polling code generated by the plug-in triggers a timeout handling event. It can be used to tell the users that the server is not responding.