Hijax

Jump to: navigation, search

Hijax is the name for the application of progressive enhancement to AJAX. This allows the use of AJAX to increase usability and responsiveness and can, as a side-effect, increase server side code quality. It is called Hijax because there is a standard HTML web page underneath but its normal communication with the server is highjacked and redirected to create the AJAX effects.

Note: This technique can harm accessibility, because developers assume that non-sighted users browse with javascript disabled. This is untrue, all interfaces either ajax, or plain HTML must be designed and tested according to aria accessibility guidelines.

In Moodle we do not require this approach to interface design as long as the javascript version of an interface complies with "Level AAA Conformance to Web Content Accessibility Guidelines 2.0"

The process

Implementing Hijax involves two steps (taken from [1]):

  1. First, build an old-fashioned website that uses hyperlinks and forms to pass information to the server. The server returns whole new pages with each request.
  2. Now, use JavaScript to intercept those links and form submissions and pass the information via XMLHttpRequest instead. You can then select which parts of the page need to be updated instead of updating the whole page.

Since Moodle has already completed the first step, and has a strong requirement to be accessible, Hijax is a highly appropriate methodology when enhancing Moodle with AJAX.


See also