Ajaxified with AHAH Page Content Page Name (for URL) Page Title Breadcrumb Text Back in summer, under the influence of [AJAX](http://www.adaptivepath.com/publications/essays/archives/000385.php) craze I decided I wanted to add a bit of AJAX-like functionality and have the blog entries update without reloading the rest of the page. I looked at a few AJAX libraries, but found them too big and too complicated. Given that what I wanted was so simple, it just didn't seem worth it. Then yesterday I read about [AHAH](http://www.crackajax.net/ahah.php), which is AJAX simplified to just two JavaScript functions, which did exactly what I wanted: make an HTTP call, get HTML from it and insert it into a div by ID. What I found surprising is how little it takes. The Javascript code (adapted from [CrackAjax.net](http://www.crackajax.net/ahah.php) is [here](http://www.freewisdom.org/jatoba/ahah.js). It is just 45 lines, which included _four_ lines that I had to write myself: function getBlogEntry(path) { return callAHAH( "http://www.freewisdom.org/jatoba/blog_fragment.php?path=" + path, "blog_entry", "<center>updating...</center>", "whoops"); } After that, all I had to do is write a PHP script that returns requested page: <?php $include_comments = '1'; $comment_key = 'entries/' . $_GET['path']; include("/home/yuri/www/en/entries/" . $_GET['path'] . "/fragment.html"); ?> I already had the text of each blog stored in a "fragment.html" in an appropriate directory, so all I had to do in this script is set a few parameters and include the file. With Ajax, you need to worry about getting the right headers, etc. Beyond that it is just a matter of adding "onclick="getBlogEntry(...); return false;" to the links. Don't put anything here Advanced Fields Category 2002200320042005200620072008200920102011201220132014E. AsiaE. EuropeL's FamilyL's FriendsN. AmericaN. EuropeS. AmericaS. AsiaW. EuropeY & LY's FamilyY's Friends Prototype Redirect Permissions0 Actions Config Markup Module HTML/Meta/Keywords HTML/Meta/Description Save Hook HTML Fields Main Head Body Header Menu Logo Page Content Template Sidebar Footer Tags Allowed for XSSFilter HTTP Fields Cache-Control Expires Guru Fields Templates Translations Fields Edit UI Admin Edit UI Don't put anything here A summary of your changes Edit Summary Don't put anything here Don't put anything here Don't put anything here Don't put anything here save preview cancel