There is a book that handles this topic very thoroughly. The code that follows with the book can be copied directly into your project. The book is
Christian Darie et al (2006 and later): "AJax and PHP - Building Responsive Web Applications."
Packt Publishing
There are two different views:
- progressive enhancement
- graceful degradation
"The beauty of it is you don't have to. The key concept is called
progressive enhancement, and it works like this:
- Write the code so that it works with the simplest user agent: anything that supports HTTP and HTML.
- Add 'bells and whistles' unobtrusively: images, CSS, JavaScript, Flash, MathML, SVG, embedded video, ...
This is far easier, and usually yields much better accessibility, than the older concept known as
graceful degradation:
- Write the code for top-of-the-line user agents, including all cool features.
- Try to make each feature degrade gracefully if not supported".
Source:
AJAX Or Nothing