Re: pros and cons of Ajax
On Sat, 27 Nov 2010, Arne Vajh?j wrote:
On 27-11-2010 11:48, Tom Anderson wrote:
On Sat, 27 Nov 2010, Arne Vajh?j wrote:
On 27-11-2010 11:02, Roedy Green wrote:
I detest javascript since so often web pages don't work in some
browsers because of JavaScript problems. It is like building your
house on sand.
Good dynamic sites provide a fallback to static HTML, so that even with
javascript switched off, they work. For example, if you use javascript
to submit a form when an option is picked from a select, then you leave
a submit button in there too, for the javascriptless to click. With a
touch of the right JS and CSS, you can then hide that submit button for
people who do have javascript if you like. Similarly, an AJAXy
add-to-cart button on a shopping site can have a normal form-submitting
action too, with javascript inhibiting it if it's able to handle the
operation via AJAX.
Browsers not supporting JS or users turning JS off are so rare today
that it is becoming less and less relevant to handle non-JS situation.
The usual responses to that are mobile browsers - where the more basic
phones still have very limited javascript support (eg my dreadful
18-month-old Blackberry Curve, where you have to go into a menu to enable
javascript on each page you need it on, whereupon it proceeds to reload
the page) and screenreaders used by the visually impaired.
Really, though, fallback is more about people with old browsers - you may
not need to fall back to a complete lack of javascript, but not everyone
has the latest features, so you should be able to do something sensible if
they don't. There's a whole field of polyfills, shims, browser resets and
so on to do this. As you said, mostly encapsulated in standard libraries.
tom
--
YOUR MIND IS A NIGHTMARE THAT HAS BEEN EATING YOU: NOW EAT YOUR MIND. --
Kathy Acker, Empire of the Senseless