Degradable Web Pages

Raxan makes it possible for developers to build degradable AJAX applications and web pages that will remain functional in the absence of JavaScript. This type of progressive enhancement allows the page to take advantage of modern browser features while still remaining presentable when such features are not present.

To enable the progressive enhancement features of a web page, you must declare and set the property $degradable="true" within the page class:

<?php
    class NewPage extends RaxanWebPage {

        protected function _config(){
            $this->degradable = true;
        }

        protected function doSomething($e) {
            ;
        }
    }

?>

Once the page is made degradable, events can be invoked from the page using hyperlinks, form submit buttons and image maps.

<?php 

    require_once('raxan/pdi/autostart.php');

    class NewPage extends RaxanWebPage {

        protected function _config(){
            $this->degradable = true;
        }

        protected function doSomething($e) {
            $this->divMsgbox->text('I am working :)');
            $this->divMsgbox->updateClient(); // update client when in ajax mode
        }
    }

?>

<a href="#" xt-bind="#click,doSomething">Click Here</a>
<div id="divMsgbox"></div>

Up Next: Quick Intro to the CSS framework