Wednesday, November 23, 2005

phajax - PHP class to do Ajax without the XmlHttpRequest object.

Inspired by the article by Dennis Pallett. I threw together a static PHP class to help with Ajax - PHP development. All you have to do is write your PHP 'view' script to display the HTML, and your PHP 'model' script to process and retrieve dynamic HTML from the server. Make the Ajax calls using this class and you are ready to go.

The flow goes somewhat like this:
  • browser sends request
  • html loads into browser
  • user clicks a button or performs an action
  • javascript event fires
  • javascript calls ajax_get passing a php script and DOM element(s) for dynamic control
  • php script performs server-side work and dynamically manipulates the passed DOM element(s) using javascript which gets dynamically loaded into the browse
Source code is released under the GPL at SF. The release package is here or follow the directions at the CVS page to get it that way. Please add enhancments and make it better, just send me a patch so I can update it and the rest of us can enjoy your awesome changes.

Technorati tags: , , ,


Post a Comment

<< Home