pros and cons of Ajax

R

Roedy Green

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. However, there must be some offsetting benefits that
make people put up with that show stopper. What are they?
 
A

Arne Vajhøj

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. However, there must be some offsetting benefits that
make people put up with that show stopper. What are they?

All modern browsers support JavaScript without having the
users to install a plugin.

And today it would be rather silly to write all JS from
scratch. You find a good JS framework and build on that.
Then a good deal of the browser specific problems are already
covered.

Arne
 
T

Tom Anderson

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.
All modern browsers support JavaScript without having the users to
install a plugin.

And today it would be rather silly to write all JS from scratch. You
find a good JS framework and build on that. Then a good deal of the
browser specific problems are already covered.

If you've got any sense, yes. There are people with no sense. For
instance, try getting the 'show all plans' link to work in Chrome on Linux
here:

http://shop.vodafone.co.uk/shop/mobile-price-plans/all-plans?initialFilters=flt_18monthplans

The problem is with badly-done javascript (nonportable, lacking in
fallback behaviour, or just plain broken). The existence of bad javascript
is not a reason to ban javascript, but i can understand that it is a
source of resentment towards javascript for end users. Especially, as on
that site, where it adds no value - the link in question there could be a
perfectly normal HTML a element which sends a perfectly normal HTTP
request. Mind you, that site was evidently implemented by people who can't
even make the 'showing n plans' text get the count right, so they're
evidently a particularly special breed.

tom
 
A

Arne Vajhøj

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.
If you've got any sense, yes. There are people with no sense. For
instance, try getting the 'show all plans' link to work in Chrome on
Linux here:

http://shop.vodafone.co.uk/shop/mobile-price-plans/all-plans?initialFilters=flt_18monthplans

The problem is with badly-done javascript (nonportable, lacking in
fallback behaviour, or just plain broken). The existence of bad
javascript is not a reason to ban javascript, but i can understand that
it is a source of resentment towards javascript for end users.
Especially, as on that site, where it adds no value - the link in
question there could be a perfectly normal HTML a element which sends a
perfectly normal HTTP request. Mind you, that site was evidently
implemented by people who can't even make the 'showing n plans' text get
the count right, so they're evidently a particularly special breed.

There are no technology that a sufficient incompetent programmer
can not use to create a mess.

Arne
 
T

Tom Anderson

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
 
A

Arne Vajhøj

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.

The WebKit based ones (Android, iPhone, S60) and IEM based (WP)
should do JS.

But OK - BlackBerry still have significant market share.

Arne
 
M

markspace

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


Firefox has a popular plugin "NoScript" which blocks Javascript. Not
everyone uses it but it's out there and a lot of security conscious
folks do use it.
 
T

Tom Anderson

Tom Anderson wrote:
...

So what is the correct fix for the visually impaired dependent on screen
readers?

There's bound to be something in jQuery for them!

My personal opinion is that sites should work with just the HTML, without
any CSS or javascript, and use semantic markup, so that they are
universally accessible - to people with old browsers, mobile phones,
screenreaders, text-mode browsers, web-to-ham-radio gateways, or whatever.
All the other stuff should build on top of that to create a happy fun time
experience for people with capable browsers, but should never be
essential. I think this is not only a humane policy, but one that leads to
good engineering, because it puts the fundamentals of the system in the
fundamental layer.

The trouble is that the business and the javascript fanboys (jCrazies?),
IME, don't see it that way. If it works in IE6 and upwards, then that's
good enough for them, and if building a page so that it falls back all the
way means dispensing with the latest jQuery gizmo, or it taking more skill
or effort to implement, then they aren't interested.

tom
 
S

Stefan Ram

markspace said:
Firefox has a popular plugin "NoScript" which blocks Javascript. Not
everyone uses it but it's out there and a lot of security conscious
folks do use it.

Some years ago, I started to keep a list of security incidents that
could have been avoided by turning off JavaScript in the browser.
Since 2006, I do not have time anymore to update and extend that list,
so the list does not have as many entries as possible.

~~ now quoting a 2006 post by me:

JavaScript might be used to validate input immediatly or to
add support, but well educated web authors do this in such a
manner that the main functionality can still be used without
JavaScript: »Google«, for example, can be used without
JavaScript, while JavaScript adds some features.

»Content developers must ensure that pages are accessible
with scripts turned off or in browsers that don't support
scripts.«

http://www.w3.org/TR/WCAG10-HTML-TECHS/

A web based computer magazine I read usually reports about 2 - 4
browser exploits and security holes a month and about 80 %
of the time the advice is »until the manufacturer has a patch
finished, the problem can be avoided by disabling JavaScript«. [1]

In an October 2004 study, 80 % of home computers were found to
be infected with spyware or adware, even though 85 % had
antivirus software installed.

http://web.archive.org/web/20050331213714/http://www.staysafeonline.info/news/safety_study_v04.pdf

»according to an alert issued Thursday by the U.S.
Computer Emergency Readiness Team (US-CERT), a division of
the Department of Homeland Security (...) A CERT alert
said Explorer users also can protect themselves by turning
off the JavaScript function in their browsers. «

http://www.washingtonpost.com/wp-dyn/articles/A6746-2004Jun25.html

»If JavaScript is enabled in these applications, then the
system is vulnerable to exploitation.«

http://www.uscert.gov/current/current_activity.html#iis5

Even Microsoft recommends to disable JavaScript:

»Under Security level for this zone, move the slider to High.«

http://www.microsoft.com/athome/security/online/browsing_safety.mspx

And Microsoft recommends not to click on links (Yes!) but to
type in URIs because of security risks by »javascript:«-links.

»Do not click any hyperlinks that you do not trust.
Type them in the Address bar yourself.«

http://support.microsoft.com/?id=833786

[1]
A selection of reports of security holes usually cured by
disabling JavaScript and related reports (Sorry: in German
language!)

http://www.heise.de/newsticker/meldung/48769
http://www.heise.de/newsticker/meldung/48725
http://www.heise.de/newsticker/meldung/63430
http://www.heise.de/newsticker/meldung/48589
http://www.heise.de/newsticker/meldung/48016
http://www.heise.de/newsticker/meldung/48016
http://www.heise.de/newsticker/meldung/47993
http://www.heise.de/newsticker/meldung/60340
http://www.heise.de/newsticker/meldung/47998
http://www.heise.de/newsticker/meldung/47494
http://www.heise.de/newsticker/meldung/47282
http://www.heise.de/newsticker/meldung/46923
http://www.heise.de/newsticker/meldung/61499
http://www.heise.de/newsticker/meldung/60240
http://www.heise.de/newsticker/meldung/69558
http://www.heise.de/newsticker/meldung/66952
http://www.heise.de/newsticker/meldung/66943
http://www.heise.de/newsticker/meldung/66511
http://www.heise.de/newsticker/meldung/67698
http://www.heise.de/newsticker/meldung/67132
http://www.heise.de/newsticker/meldung/69894
http://www.heise.de/newsticker/meldung/68579
http://www.heise.de/newsticker/meldung/69225
http://www.heise.de/newsticker/meldung/66846
http://www.heise.de/newsticker/meldung/68391
http://www.heise.de/newsticker/meldung/69015
http://www.heise.de/newsticker/meldung/66480
http://www.heise.de/newsticker/meldung/66928
http://www.heise.de/newsticker/meldung/66350
http://www.heise.de/newsticker/meldung/64771
http://www.heise.de/newsticker/meldung/58788
http://www.heise.de/newsticker/meldung/61350
http://www.heise.de/newsticker/meldung/59374
http://www.heise.de/newsticker/meldung/60644
http://www.heise.de/newsticker/meldung/60855
http://www.heise.de/newsticker/meldung/64426
http://www.heise.de/newsticker/meldung/60615
http://www.heise.de/newsticker/meldung/68394
http://www.heise.de/newsticker/meldung/58228
http://www.heise.de/newsticker/meldung/61700
http://www.heise.de/newsticker/meldung/61646
http://www.heise.de/newsticker/meldung/61828
http://www.heise.de/newsticker/meldung/57578
http://www.heise.de/newsticker/meldung/56354
http://www.heise.de/newsticker/meldung/54973
http://www.heise.de/newsticker/meldung/59330
http://www.heise.de/newsticker/meldung/56795
http://www.heise.de/newsticker/meldung/56323
http://www.heise.de/newsticker/meldung/53382
http://www.heise.de/newsticker/meldung/59449
http://www.heise.de/newsticker/meldung/54272
http://www.heise.de/newsticker/meldung/56646
http://www.heise.de/newsticker/meldung/53186
http://www.heise.de/newsticker/meldung/53042
http://www.heise.de/newsticker/meldung/54063
http://www.heise.de/newsticker/meldung/52995
http://www.heise.de/newsticker/meldung/52935
http://www.heise.de/newsticker/meldung/55138
http://www.heise.de/newsticker/meldung/54716
http://www.heise.de/newsticker/meldung/52844
http://www.heise.de/newsticker/meldung/54431
http://www.heise.de/newsticker/meldung/54734
http://www.heise.de/newsticker/meldung/54487
http://www.heise.de/newsticker/meldung/54605
http://www.heise.de/newsticker/meldung/55396
http://www.heise.de/newsticker/meldung/53582
http://www.heise.de/newsticker/meldung/52776
http://www.heise.de/newsticker/meldung/52752
http://www.heise.de/newsticker/meldung/61245
http://www.heise.de/newsticker/meldung/52365
http://www.heise.de/newsticker/meldung/52377
http://www.heise.de/newsticker/meldung/54636
http://www.heise.de/newsticker/meldung/54719
http://www.heise.de/newsticker/meldung/54714
http://www.heise.de/newsticker/meldung/54697
http://www.heise.de/newsticker/meldung/52377
http://www.heise.de/newsticker/meldung/54582
http://www.heise.de/newsticker/meldung/52390
http://www.heise.de/newsticker/meldung/52255
http://www.heise.de/newsticker/meldung/54352
http://www.heise.de/newsticker/meldung/51995
http://www.heise.de/newsticker/meldung/51751
http://www.heise.de/newsticker/meldung/53644
http://www.heise.de/newsticker/meldung/60908
http://www.heise.de/newsticker/meldung/51511
http://www.heise.de/newsticker/meldung/50968
http://www.heise.de/newsticker/meldung/50363
http://www.heise.de/newsticker/meldung/50128
http://www.heise.de/newsticker/meldung/50111
http://www.heise.de/newsticker/meldung/50179
http://www.heise.de/newsticker/meldung/53489
http://www.heise.de/newsticker/meldung/52018
http://www.heise.de/newsticker/meldung/54188
http://www.heise.de/newsticker/meldung/49517
http://www.heise.de/newsticker/meldung/53499
http://www.heise.de/newsticker/meldung/49219
http://www.heise.de/newsticker/meldung/49219
http://www.heise.de/newsticker/meldung/49240
http://www.heise.de/newsticker/meldung/49240
http://www.heise.de/newsticker/meldung/49240
http://www.heise.de/newsticker/meldung/48877
http://www.heise.de/newsticker/meldung/48793
http://www.heise.de/newsticker/meldung/48892
http://www.heise.de/newsticker/meldung/53964
http://www.heise.de/newsticker/meldung/53519
http://www.heise.de/newsticker/meldung/53544
 
A

Arne Vajhøj

There's bound to be something in jQuery for them!

My personal opinion is that sites should work with just the HTML,
without any CSS or javascript, and use semantic markup, so that they are
universally accessible - to people with old browsers, mobile phones,
screenreaders, text-mode browsers, web-to-ham-radio gateways, or
whatever. All the other stuff should build on top of that to create a
happy fun time experience for people with capable browsers, but should
never be essential. I think this is not only a humane policy, but one
that leads to good engineering, because it puts the fundamentals of the
system in the fundamental layer.

The trouble is that the business and the javascript fanboys (jCrazies?),
IME, don't see it that way. If it works in IE6 and upwards, then that's
good enough for them, and if building a page so that it falls back all
the way means dispensing with the latest jQuery gizmo, or it taking more
skill or effort to implement, then they aren't interested.

For simple traditional web apps form-submit-form-submit-form-submit
(what Struts was excellent at!) then you don't need JS.

But for GMail, Google Maps, Google Docs etc. then usability
would crash without JS.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top