The Xanjax Story


Brief Description

Xanjax is a client side AJAX framework, with full support for traditional Internet browser navigational behaviour. By enabling AJAX with navigational support, and leveraging this capability with functions such as XML to HTML conversion and support for progressive enhancement, Xanjax makes AJAX feasible for entire website content delivery.

Knowledge or use of a server side language or framework is not necessary since Xanjax works client side. There is support for POST requests and JSON however, and PHP Server Pushlets too, so users at home with server side technology will find plenty of useful features. Note that JSON can be employed in flat files to create dynamic menus and lists without recourse to server side scripting.


Background - AJAX & Navigation

Traditional browser navigational behaviour is highly intuitive. After giving an initial address, links and back/forward buttons are simply clicked to get around. This highly desirable navigational behaviour, along with bookmarking, was without a doubt pivotal in bringing the Internet to ordinary people. Even untrained, most anyone can access the Internet simply by clicking, while bookmarking for future reference along the way.

Although AJAX technology offered a broad promise of greater responsiveness and interactivity, web sites prior to Xanjax have mostly been narrowly focussed on improving interactivity of limited types of content. While this has led to some very useful and interesting 'Web 2' innovations, attempts at comprehensive AJAX website design have mostly so seriously broken traditional browser navigation that this has generally been avioded.


Standard Browser Behaviour

Unfortunately, old web technology results in complete page rendering for every link activation regardless of whether new page content is mostly similar to any previous content or not. This is not only visually ugly as, regardless of size or significance of content, even minor delays affect page rendering, causing temporary gaping holes and/or layout problems. Much worse, the browser sometimes becomes totally unresponsive during parts of its download phase.

This has led in part to the pun 'world wide wait,' on the acronym 'www.' The situation is exacerbated of course by the hunger for bandwidth chewing rich graphic content, which seems to readily outpace and outspace widespread broadband adoption and speed improvement. Additionally, no matter how fast the connection speed to an Internet backbone, the full connection path is nevertheless a serial connection passing through many nodes between browser and web server. Effective bandwidth is always limited to the speed of the slowest node in the route. Anything along the way, for example server overload, link overload, porn filters, virus filters, or workstation overload, can and quite often does slow a connection to a crawl, falling below even dialup speeds.

Significantly, modern Internet browsers still basically operate the same way, the only real offsetting improvements in this regard being smarter content caching linked with smarter display refreshing. Faced with network link delays as described above, today's browsers still suffer from exactly the same problems of stalling and visual ugliness. Surely we could use AJAX techniques to improve things!


AJAX Promises

A specific AJAX supporting technology, XMLHttpRequest, built into most modern Internet browsers has led some web designers to salivate in contemplation. Combining XMLHttpRequest with Javascript and Document Object Model (DOM) technologies makes it technically possible to update any portion of a page without the browser doing either a full page reload, or having any possibility of stalling.

The term AJAX (Asynchronous Javasript And XML), has been coined to signify the combination of XMLHttpRequest, Javascript and Document Object Model (DOM) technologies, either in partial page rendering or other browser/web server interaction. Often used synonomously with the term 'Web 2,' AJAX more accurately applies to the technical means behind enhanced browser communications and content interactivity, whereas 'Web 2' more correctly refers to the actual implementation into advanced Web based applications of some kind which depend on the enhanced behaviour made possible. Use of AJAX in and of itself doesn't necessarily consitute a 'Web 2' application; AJAX is also used in more mundane applications such as form submission.


AJAX Limitations

XMLHttpRequest is arguably one of the really positive Microsoft contributions to Internet browser technology. However, continued non-compliance with many World Wide Web Consortium (W3C) recommendations has lead to strong criticism of Microsoft. This is especially so among responsible web designers struggling to create cross browser compatible W3C compliant content, who suffer huge costs and lost time daily for no other reason than Microsoft's stubborn resistance to full adoption of W3C recommendations. Importantly, the very lack of comprensive W3C compatibility in Microsoft's browsers hugely inhibits practical solutions, in spite of their quite useful contribution of XMLHttpRequest.

Unfortunately, other significant difficulties also exist. XMLHttpRequest wasn't designed as a specific solution to traditional browser shortcomings, really being intended for incidental asynchronous communications with a web server, for form verification and submission or other similar purposes. As a result, XMLHttpRequest is totally void of any browser navigational support.

Browser navigation, history and bookmarking issues, together with excessive cross browser design difficulties in using the DOM (the latter mostly being due to Microsoft's patchy adoption of W3C recommendations), have beset almost all attempts at broader website solutions using AJAX. Largely, the alleviation of traditional browser rendering ugliness, tardiness and non-responsiveness has been an unfulfilled dream.

Today, although AJAX is widely used for partial page updates that don't require traditional browser navigation, such as inclusion of advertisements or other dynamic content, and for so called 'Web 2' applications such as Google Maps or Yahoo Mail, there are very few web sites, if any, using AJAX as a total solution. Typically today, AJAX techniques are used for content enhancement; rarely for general content delivery.

Many 'Web 2' applications require (or would at least greatly benefit from) traditional browser navigation. Often, navigation is left out of 'Web 2' applications just because it's too hard! This annoys users and inhibits search engine effectiveness, thereby reducing the potential of 'Web 2.'


Xanjax As A Solution

Following in the footsteps of a few others, the founder of Xanjax, David Chapman, itched for a solution, and eventually found he had to scratch the itch.

Considerable work, and even a couple of more or less complete solutions, such as Really Simple History, precede Xanjax. To David however, when he began Xanjax about a year ago, without lots of extra work the existing solutions didn't seem small enough, fast enough, or sufficiently bug free or comprehensive enough for complete production web site design.

Size and speed limitations were the main deciders in David ruling out existing solutions. These seemed to be caused mainly by cross-browser compatibility issues; mostly revolving around Microsoft browsers lack of proper W3C DOM support, rather than limitations directly caused by the designers themselves who were obviously skilled and dedicated to the task.

Clearly, a different approach was needed; exploiting limited common W3C compatibility that does exist across browsers instead of multiple browser detection and patching, and driven exclusively by events rather than consuming computing resources polling for changes. Existing developers described using a hash appended url (meant for navigating to page anchors) to signal an AJAX update without causing a browser refresh. This technique provided a basis (with some known limitations and a few more ugly ones to be found and solved) for browser history retention and bookmarking.

This starting point for Xanjax lead to a most daunting and gruelling project. Superficially trivial, re-creation of browser navigational features in an event driven AJAX context was frustratingly elusive, as was the mantra for W3C common ground between browsers. Although David's original design goals weren't quite 100% realised, there was enough success for a fully event driven Xanjax to be born anyway. Other AJAX supporting modules (sufficient to build a functional web site at least as complex as this one, which is of course Xanjax Powered), got developed along the way.

Xanjax turned out surprisingly well; it's fully event driven, fast and tiny, with just a few known bugs (only a few known yet anyway). The essential components, which include XML to HTML conversion, consume less space and bandwidth than a typical minor graphic. The essential Xanjax index.html framework component validates to W3C XHTML 1.0 Strict and although Xanjax content is typically served as an XHTML 1.0 Strict subset of XML, there is builtin flexibility to render earlier HTML specifications in a pre-defined object. Thus, Xanjax provides an incremental upgrade path for existing websites as well as fully supporting XHTML 1.0 Strict. Probably more than 90% of web users are catered for, with Xanjax supporting IE 5.5, IE 6.1, IE 7.0, and Firefox. Opera has a minor issue and will most likely be made to work.

David decided to release Xanjax to the public as open source software under a GNU licence, in the hope that it might become widely adopted and continuously improved.

If you want to use AJAX with traditional browser navigational capability in a minimalist framework, think Xanjax. Whether for building an entirely new website, upgrading an old one, or forming a basis for a highly responsive browser based intranet or extranet application, please try and enjoy Xanjax.

Note: Xanjax is very new, and in pre-beta status. There are some known issues with it and probably a few unknown as well. Really Simple History may well be a better choice for production use right now, as it has had further development since a year ago and is already in use. On the other hand, Xanjax is quite a lot smaller, probably faster, includes XML to HTML support, XHTML strict support even using virtual frames and support for progressive enhancement. Why not try both before deciding what's best for your application?