By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,945 Members | 1,432 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,945 IT Pros & Developers. It's quick & easy.

Contradiction of Advice?

P: n/a

They say not to use JavaScript for important things, but doesn't that
mean relegating JavaScript usage to frivolous effects?

It's said to consider whether it's truly necessary to use JavaScript,
whether some non-script way is available for achieving the same
result. On the one hand, good practice dictates that a site degrade
gracefully where JavaScript is concerned...but on the other, that
means that JavaScript will be used only for non-critical effects.

And speaking of effects, isn't that what JavaScript is all about --
behavior, which means actions that produce certain effects??

Jun 27 '08 #1
Share this Question
Share on Google+
16 Replies


P: n/a
Prisoner at War wrote:
They say not to use JavaScript for important things, but doesn't that
mean relegating JavaScript usage to frivolous effects?
It would be better to say "Don't depend on JavaScript for essential things".

Create something that works without JavaScript (even if it is slow and
clumky), and then layer scripting on top to improve the usability (removing
the clunkyness for users who's client support the the JS).
--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Jun 27 '08 #2

P: n/a
Prisoner at War escribió:
They say not to use JavaScript for important things, but doesn't that
mean relegating JavaScript usage to frivolous effects?
I'd say the advice is: don't risk breaking basic functionality by using
superfluous JavaScript.

Example: I'm tired of sites that replace regular links with stuff like
<a href="javascript:makeLink('/pages/products.php?id=666')"></aand
manage to break:

- Search engines
- Open link in new tab
- Save target as
- Copy link location
- Bookmark link

.... while providing no new functionality at all. Not to mention forms
you can't submit because they have no submit button or URL and there's a
JavaScript error on the page.

--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Jun 27 '08 #3

P: n/a
On Wed, 14 May 2008 19:21:01 -0700, Prisoner at War wrote:
[...]
On the one hand, good practice dictates that a site degrade
gracefully where JavaScript is concerned...but on the other, that
means that JavaScript will be used only for non-critical effects.
Exactly. At least if you care for your users (including screenreaders,
braille keyboards, firewalled browsers with filtered JS, and all those
people who intentionally disable JS for security reasons) you'll want
to use JS (if at all) only to _enhance_ the usuablity of your page(s).
And speaking of effects, isn't that what JavaScript is all about --
behavior, which means actions that produce certain effects??
Sure. But that's an "addon" not a replacement for something that works
very well w/o JS (like links or forms). And a nice behaviour (e.g.
for supporting form input and validating it) is definitely no ersatz
(replacement) for server side validation. Only too often the behaviour
is more like infantilizing than helpful.
--
Matthias
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
Jun 27 '08 #4

P: n/a
On 05/15/08 01:06 am, Álvaro G. Vicario wrote:
Prisoner at War escribió:
>They say not to use JavaScript for important things, but doesn't that
mean relegating JavaScript usage to frivolous effects?

I'd say the advice is: don't risk breaking basic functionality by using
superfluous JavaScript.

Example: I'm tired of sites that replace regular links with stuff like
<a href="javascript:makeLink('/pages/products.php?id=666')"></aand
manage to break:

- Search engines
- Open link in new tab
- Save target as
- Copy link location
- Bookmark link

... while providing no new functionality at all. Not to mention forms
you can't submit because they have no submit button or URL and there's a
JavaScript error on the page.
An example of such a problem is <www.instantssl.com>. Using Seamonkey
v1.1.9 I cannot log onto the site because the *required* Javascript
functions crash. I reported this a week ago; it is not fixed yet.
Think about how your visitors feel about your site with all the whizbang
JS effects that prevent them from doing anything useful. Like following
links, or logging in.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jun 27 '08 #5

P: n/a
In comp.lang.javascript message <g0**********@registered.motzarella.org>
, Thu, 15 May 2008 07:44:24, David Dorward <do*****@yahoo.composted:
>Prisoner at War wrote:
>They say not to use JavaScript for important things, but doesn't that
mean relegating JavaScript usage to frivolous effects?

It would be better to say "Don't depend on JavaScript for essential things".

Create something that works without JavaScript (even if it is slow and
clumky), and then layer scripting on top to improve the usability (removing
the clunkyness for users who's client support the the JS).
Rather simplistic; perhaps your experience is limited to the commercial
world. & YGCIB.

A business wishing to attract as much trade as possible by the use of
the Web ought to ensure that the Web experience that they offer to those
who do not run JavaScript is good enough for their purpose, and free of
visible deficiency caused to script not running. If it is felt that
customers may be impressed by "decorative" features, then JavaScript is
one way of adding such; and it might also be used to add real value to
the web site. And that is, of course, the most common case.

But a business that wants some more trade but is limited in what it can
handle may not need to ensure that all visitors to the site receive the
full marketing blast.
Outside (and inside) commerce, JavaScript can also be used to provide
sandboxed computational facilities, and for the public derivation and
demonstration of algorithms.

There is no justification for limiting what is done with JavaScript
merely because some people, some of the time, do not run it.

If a site is significantly better with JavaScript, those without it
should be politely informed that they could do better by enabling it or
by going to a system which does have it.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "" (SonOfRFC1036)
Jun 27 '08 #6

P: n/a
On May 15, 2:44 am, David Dorward <dorw...@yahoo.comwrote:
>

It would be better to say "Don't depend on JavaScript for essential things".
Yes, which suggests that JavaScript is relegated for non-essential
things...which seems a high cost-benefit ratio...said "cost" being the
time it takes to learn JavaScript...I mean, learning "programming
lite" to do non-essential things??
Create something that works without JavaScript (even if it is slow and
clumky), and then layer scripting on top to improve the usability (removing
the clunkyness for users who's client support the the JS).
Sorry, but to what "clunkiness" are you referring?? How does
JavaScript improve webpage clunkiness, whatever that is???
--
David Dorwardhttp://dorward.me.uk/http://blog.dorward.me.uk/
Jun 27 '08 #7

P: n/a
On May 15, 5:36 am, Matthias Watermann <li...@mwat.dewrote:
>

Exactly. At least if you care for your users (including screenreaders,
braille keyboards, firewalled browsers with filtered JS, and all those
people who intentionally disable JS for security reasons) you'll want
to use JS (if at all) only to _enhance_ the usuablity of your page(s).
So would this be an example of "enhanced usability"...a site that
sells bras...it can have a good old-fashioned size-chart, and it can
provide a JavaScript bra-size calculator for those whose JavaScript is
enabled...is that it? Is that what the role of JavaScript is: a
fancier way of doing something that's already possible and perfectly
fine??

Seems to me that there is a necessary tension between the "promise" of
a technology like JavaScript and the dictum to, practically speaking,
not use it too much too extensively....
Sure. But that's an "addon" not a replacement for something that works
very well w/o JS (like links or forms). And a nice behaviour (e.g.
for supporting form input and validating it) is definitely no ersatz
(replacement) for server side validation. Only too often the behaviour
is more like infantilizing than helpful.
Infantilizing?? I wonder what you mean. I'm not sure that I've ever
come across a site that used JavaScript to replace good old-fashioned
HTML links and forms....
--
Matthias
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
Jun 27 '08 #8

P: n/a
Prisoner at War wrote:
On May 15, 2:44 am, David Dorward <dorw...@yahoo.comwrote:
>Create something that works without JavaScript (even if it is slow and
clumky), and then layer scripting on top to improve the usability
(removing the clunkyness for users who's client support the the JS).

Sorry, but to what "clunkiness" are you referring?? How does
JavaScript improve webpage clunkiness, whatever that is???
For example.

A form allows the user to enter a number. The user enters a letter by
mistake, submits the form, the server side script catches the error, and
returns a page containing a prepopulated form to the user along with an
error message.

This takes some time.

Add JavaScript...

If the browser doesn't support the JS, then the above scenario still plays
out. If the browser does support it, the data is tested on the browser, and
the user is alerted to the problem without the round trip to the server.

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Jun 27 '08 #9

P: n/a
VK <sc**********@yahoo.comwrites:
Just a few samples of well known Web 2.0 services that came first to
Please explain what "Web 2.0" means :)
It's marketing speech for "newer and better than the rest, but we
can't say how".

If Web 2.0 has any meaning, it's about user generated content.
Scripting is not necessary for that.
my mind and visited with Javascript disabled:
http://www.geocities.com/schools_ring/tmp/facebook.png
http://www.geocities.com/schools_ring/tmp/gmail.png
http://www.geocities.com/schools_rin...oogle_docs.png
http://www.geocities.com/schools_ring/tmp/youtube.png
Google Docs is an application more than it is a web-page.
It does need scripting to work, because it performs client-side
calculations. It would be incredibly awkward without scripting.

GMail uses scripting to immitate an application, but doesn't really
need it for anything but extra bells and whistles. It has a fallback
for script-disabled browsers, and works adequatly with Javascript
disabled (better than most other web-mails I have seen).

Youtube shouldn't need scripting at all for what it does (but it does
apparently use it to start the flash player). I wish it did use AJAX,
so I could page through comments without interrupting the movie.

I don't know what facebook does, but I guess most of its essential
features would work fine without scripting.

Of these, only YouTube and Facebook are what I would consider Web 2.0
applications (as much as it makes sense at all).

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jun 27 '08 #10

P: n/a
On Thu, 15 May 2008 11:36:27 +0200, Matthias Watermann wrote:
....
Only too often the behaviour
is more like infantilizing than helpful.
You're talking about Vista, right? ;-)

Cheers!
Rich

Jun 27 '08 #11

P: n/a
On Wed, 21 May 2008 18:47:47 +0000, Rich Grise wrote:
On Thu, 15 May 2008 11:36:27 +0200, Matthias Watermann wrote:
...
> Only too often the behaviour
is more like infantilizing than helpful.

You're talking about Vista, right? ;-)
Well, I'm unable to confirm or deny that as I abandoned that family of
socalled operating systems about fifteen years ago. The real problem
with those software products is that meanwhile a lot of people grew up
under the impression that what they see and are forced to do with
WinDOS boxes is the true or natural thing to do. Just a tiny example:
Does anybody think about the TAB character nowadays? It's a character,
in fact, but over the years it became a navigational key instead (like
the arrow keys). - Hmm, that may be off-topic, but at least it's one
incarnation of the problem we were discussing in this thread: That
people should _think_ about what they're doing instead of just barking
with the pack.
--
Matthias
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
Jun 27 '08 #12

P: n/a
Matthias Watermann <li***@mwat.dewrites:
Just a tiny example:
Does anybody think about the TAB character nowadays? It's a character,
in fact, but over the years it became a navigational key instead (like
the arrow keys).
I really, really wish they would do away with the TAB "character"
completely. It never causes anything but problems anyway.
Langauges with significant whitespace, which I approve of on the
theoretical level, are darn near unusable in a generic editor
that might, or might not, use both tabs and spaces.

TAB isn't a character as such, it's a "control character", aka. a
control *code*, not really a character. A byte value sent to a line
printer that represented an action (like carrige return and line
feed).

We still have both carrige return and linefeed (although we only
really need one in practice: newline), and we still have tab,
which we don't need at all for text.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jun 27 '08 #13

P: n/a
On Thu, 22 May 2008 11:46:47 +0100, Dr J R Stockton wrote:
Therefore, your "contribution" is devoid of value.
So, do you have a worthwhile replacement, or is bitching the best
that you can come up with?

And I still maintain that telling your customers "You have to change YOUR
equipment to see our site" is a really, really stupid thing to do, if your
intent is to attract customers.

Thanks,
Rich

Jun 27 '08 #14

P: n/a
In comp.lang.javascript message <pa***************************@example.n
et>, Thu, 22 May 2008 19:45:01, Rich Grise <ri**@example.netposted:
>On Thu, 22 May 2008 11:46:47 +0100, Dr J R Stockton wrote:
>Therefore, your "contribution" is devoid of value.

So, do you have a worthwhile replacement, or is bitching the best
that you can come up with?
It seems to be the appropriate response for the foolish article that you
wrote. If you don't like to have your articles criticised, the minimum
requirement is to write sensible ones.
>And I still maintain that telling your customers "You have to change YOUR
equipment to see our site" is a really, really stupid thing to do, if your
intent is to attract customers.
That is, of course, not what I wrote.

As it happens, I was just reading the source of a NASA News Release. It
contains "Your browser or your browser's settings are not supported. To
get the best experience possible, please download a compatible browser.
If you know your browser is up to date, you should check to ensure that
javascript is enabled."

The page is <http://www.nasa.gov/home/hqnews/2008...8133_Shuttle_t
arget_dates.html>; it's amusing to read its code to see just what it
contains. It has 'CONTENT="2008-05-22"' indicating that even a USG
Agency sometimes used a sensible numeric date format. It uses
navigator.appName, navigator.appVersion, navigator.userAgent.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE7 FF2 Op9 Sf3
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Jun 27 '08 #15

P: n/a


Matthias Watermann wrote:
On Wed, 21 May 2008 18:47:47 +0000, Rich Grise wrote:
On Thu, 15 May 2008 11:36:27 +0200, Matthias Watermann wrote:
...
Only too often the behaviour
is more like infantilizing than helpful.
You're talking about Vista, right? ;-)

Well, I'm unable to confirm or deny that as I abandoned that family of
socalled operating systems about fifteen years ago. The real problem
with those software products is that meanwhile a lot of people grew up
under the impression that what they see and are forced to do with
WinDOS boxes is the true or natural thing to do. Just a tiny example:
Does anybody think about the TAB character nowadays? It's a character,
in fact, but over the years it became a navigational key instead (like
the arrow keys). - Hmm, that may be off-topic, but at least it's one
incarnation of the problem we were discussing in this thread: That
people should _think_ about what they're doing instead of just barking
with the pack.

I agree with this.
Another thing to think about is that sites like Facebook are perhaps
in a lot of ways breaking the law in many countries by not makeing
information accessible.
--
Regards Chad. http://freewebdesignonline.org
Jun 27 '08 #16

P: n/a

Prisoner at War <pr*************@yahoo.comwrites:
They say not to use JavaScript for important things, but doesn't that
mean relegating JavaScript usage to frivolous effects?
If you look at google maps -- the main reason we're stuck with all this
AJAX stuff these days -- you'll see that it does whizzy things
with Javascript on (pre-caching map data so you can scroll around on it
by dragging), but if you shut it off it still hands you a map, it's just
a static one without the spiffy interactive scrolling.

So there you have it: the feature critical for google maps success is
implemented via Javascript, but it degrades to something useful without
it.

Aug 19 '08 #17

This discussion thread is closed

Replies have been disabled for this discussion.