Published on 2006-01-28 07:57:35

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.

Previous Page


Related Entries

Member of the PHP Magazine Network, Copyright (C) 2005-2008 phpmagazine.net All Rights Reserved