PHP Classes

code availability

Recommend this page to a friend!

      PHP Classes blog  >  PHPClasses 2.0 Beta, ...  >  All threads  >  code availability  >  (Un) Subscribe thread alerts  
Subject:code availability
Summary:can we download your implementation?
Messages:3
Author:Craig Nuttall
Date:2006-04-05 13:29:22
Update:2006-04-05 18:33:20
 

  1. code availability   Reply   Report abuse  
Picture of Craig Nuttall Craig Nuttall - 2006-04-05 15:30:42
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!

Thanks,
-Craig

  2. Re: code availability   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-04-05 16:07:11 - In reply to message 1 from Craig Nuttall
Yes, as it was mentioned in the post, there is a forms generation class that comes a plug-in to submit forms using AJAX with an hidden IFrame.

phpclasses.org/formsgeneration

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.

  3. Re: code availability   Reply   Report abuse  
Picture of Craig Nuttall Craig Nuttall - 2006-04-05 18:33:20 - In reply to message 1 from Craig Nuttall
Thanks! I missed the part referring to the download b/c I kept reading from the IFRAME discussion down ;-)

-Craig