473,396 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Contradiction of Advice?


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
16 1098
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
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
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
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
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
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
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
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
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
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
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
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
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
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


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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

75
by: Howard Nease | last post by:
Hello, everyone. I would appreciate any advice that someone could give me on my future career path. Here is my situation: I am a bright Junior in a very well-respected private high school, taking...
1
by: Abelardo Vacca | last post by:
Hello, I am currently in the process of switching our application to a N-Tier model with .NET. One of the aspects we want ot get right from the start not to worry about it after is the...
11
by: ma740988 | last post by:
I'm perusing a slide with roughly 12 bullets spread across 3 pages. Each bullet reflects 'advice'. I'm ok with all but 1 bullet, more specifically the bullet that states: " Avoid the STL unless...
6
by: J Rieggle | last post by:
Hi there, I am stuck on a problem that relates to eCommerce sites, but isnt ASP.NET specific (sorry). The ecommerce site is working in the UK, and products will be sold in pounds stirling. ...
12
by: Joe Abou Jaoude | last post by:
hi, I have a component that uses a database connection. In the finalizer I dispose the connection because I read in msdn the following: "A type must implement Finalize when it uses...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
7
by: John Paul | last post by:
I'm thinking of building an e-commerce site in php. Anyone got any advice in building one? What is the best way to implement a payment system? Are any legal issues involved? Thanks,
3
by: mesut | last post by:
Hi colleagues, I need your advice... I have approx 1,5 years experience with ASP.NET/VB.NET 2005 and I have to switch over into C# 2005 language. I don't have experience with C# 2005...
3
by: Scott M. | last post by:
Scenario: ASP .NET 2.0 Web "Site" All but one page is written using inline VB .NET code. One page is written using VB .NET code-behind. MSBuild options are set at the default (allow pages to be...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.