Online documentation for the com.bydust.ajax Class

What the hell is this ?

Simple question, simple answer. The com.bydust.ajax class is simply a javascript class that automatically converts your static website into a full-blown ajaxed website. Whenever a user visits your website, the class will perform a browser-check. If your visitor's browser is capable of running the needed javascript, we will convert the website automatically. If not, the script deactivates itself and the visitor browses through your website as it is ( without ajax request etc. ).

Yeah ok, but what happens when there's an error?
It would be nice if everything was perfect, but sometimes unsuspected things pop up. If - somehow - an error would occur, your visitor will still be able to browse your website because the script does not change any links or form elements, it just "modifies" them.

A long story short, whenever a user clicks on a link, your browser checks the link to see what page he has to request from the server. The javascript class intercepts this request and looks which page is requested, so it can request the page using its own engine. The server replies to the request - as it would do to a normal browser request - and serves the requested page. Our script then downloads that page from the server, filters the information it needs ( your primary and secundary content area's ) and displays them on your website ! Whenever an error occurs somewhere in that process, the request from the user will not be intercepted by the script and your browser will handle the user's request, as it would do without the javascript class implemented. Everything still works !

Basic implementation

The implementation of the javascript class is really easy, you just need to add a few lines of code into your pages. These will load and launch the script, and mark the area's you want to refresh on each page. Look at the implementation page for more information.

Custom rules

By adding custom rules to the script you can specify which links or forms NOT to include in the script. This can be usefull for various situations, for example Wordpress themes. Not really needed, since the script will automatically launch a new window if it notices it can't open the requested page or file. Improves usability tho. See the rules for more information.

Event listeners

Attaching event listeners to certain events launched by the script allows you to execute certain pieces of code whenever an event happens, for example on errors or page loads. More about this on the event listeners page.

Animation

Don't know if you've noticed this already, but whenever a page is requested a little animation happens. There are two types of animations, and they are customizable ! Read more about animations.

Allowed Extensions

Its pretty obvious that the script cannot parse all kinds of filetypes, so its also usefull to specify what filetypes are to be handled by the visitor's browser. Read more about the allowed extensions.