CBL Partial Updater, Simple AJAX library for PHP
CBL Partial Updater is an AJAX library for PHP. Unlike other libraries, all operations are controlled by the server side. Using the library, it is very easy to add AJAX features to existing PHP applications. Just add a few lines to your PHP and HTML, and your web application turns into an AJAX app.

The usage of CBL Partial Updater is simple as including the prototype and CBL libraries, then by setting the onsubmit event for the form in the client side :
<script language="JavaScript" src="prototype.js"></script>
<script language="JavaScript" src="partialupdater.js"></script>
...
<span id='count'><% = $num %>
...
<form onSubmit="CBL_PartialUpdater.update('index.php', this); return false">
...
</form>
Then in the server side depending on using Smarty or no, you can simply use for smarty
require_once 'partialupdater.class.php'; ... CBL_PartialUpdater::display($smarty, 'index.tpl', 'count');
and for normal pages :
require_once 'partialupdater.class.php';
...
ob_start();
...
your HTML output code
...
CBL_PartialUpdater::ob_end('count');
You can find also on the website howto add support for live search and displaying the progress indicator. CBL Partial Updater is written in PHP and require the HTML Parser for PHP4 and the prototype library. Demo is available in the website. Released under LGPL license.


Subscribe to AJAX Magazine's feed