The Millennial Star

Off Topic: My Open Source Project

This has nothing to do with LDS issues, but since my co-bloggers haven’t had much to say this week, and there are plenty of you LDS bloggers out there who are interested in web development, I thought I’d post about my very first open source project. Most of you have probably seen and used the javascript commenting hacks I wrote for blogger-based blogs last year under the name Ebenezer Orthodoxy. Well, my latest project is more abstract and widely applicable, and has potential to revolutionize PHP based web sites, including blogging software like WordPress and b2evolution. And it is free.

The newest buzzword in web development is Ajax. If you haven’t heard about it you soon will. Ajax is a name recently coined to describe the combination of technologies that have been used to create the new generation of fancy websites like GMail and Google Maps. At the core of these fancy new web-based applications is the Javascript XMLHttpRequest object, which permits a web page to request additional information from the server without reloading the web page.

I have created a PHP class library to facilitate the easy development of web based applications that use Ajax to communicate with the server asynchronously and update web page content. I call my library xajax.

Basically, the xajax PHP class automatically generates JavaScript wrapper functions for the PHP functions you want to be able to call asynchronously from your web page. When called, these wrapper functions use JavaScript’s XMLHttpRequest object to asynchronously communicate with the xajax class on the server which calls the corresponding PHP functions. Upon completion, an xajax XML response is returned from the PHP functions, which the xajax class passes back to the web page. The XML response contains instructions and data that are then parsed by xajax’s JavaScript message pump and used to update the content of your web page.

Because Ajax uses only standard technologies like HTML DOM, CSS, and Javascript, xajax lets you use PHP to provide rich content and interfaces without having to install a plugin like Macromedia Flash. It works in Mozilla based browsers, like Firefox, as well as in Internet Explorer and Safari.

The potential for blogs is unexplored. One possible use would be a javascript function that would automatically query the server for new comments every 30 seconds and update the recent comments list without having to reload the page. How many times have you posted a lengthy comment only to find that while you were typing, someone else posted nearly the same thing. Using xajax, it might be possible to continue to display new comments on the page as they are posted, while comments are being composed. Commentators could see the new comments appear without having to reload.

There are usability issues to be considered, but the potential is exciting.

My xajax library homepage is at http://xajax.sourceforge.net.

I would love to see the Bloggernacle become a leader in blogging innovation. Feel free to explore possibilities here in the comments.

Exit mobile version