468,133 Members | 1,155 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

JS Guru needed! Why doesn't this work?

My pages need to unfold gracefully even if Javascript is disabled, but
I can't get this to work?

Please help, Javascript Gurus!!

<noscript>
document.write('<span class=warning><b>Warning</b>: You must enable
javascript for this page to work properly!</span>')
</noscript>

Thanks so much,
Ann

Nov 23 '05 #1
13 1179
There is some paradox in your code...
If Javascript is disabled (or unavailable on "really old" browser), it
means it cannot execute any kind of JS.
And you're asking to execute some JS when there is no JS.uh ? :-)
Means :
<noscript>
<span class=warning>Warning, you must...</span>
</noscript>

Antoine

Nov 23 '05 #2
Giggle Girl said the following on 11/21/2005 10:30 AM:
My pages need to unfold gracefully even if Javascript is disabled, but
I can't get this to work?

Please help, Javascript Gurus!!

<noscript>
document.write('<span class=warning><b>Warning</b>: You must enable
javascript for this page to work properly!</span>')
</noscript>


<noscript>
<span class="warning">I do not have a clue how to make my page work with
javascript disabled so you must come back with a script enabled browser
to see a page that probably isn't worth seeing to start with</span>
</noscript>

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 23 '05 #3
VK

Randy Webb wrote:
<noscript>
<span class="warning">I do not have a clue how to make my page work with
javascript disabled so you must come back with a script enabled browser
to see a page that probably isn't worth seeing to start with</span>
</noscript>


<noscript>
<span class="warning">
My web application is based heavily on JavaScript. I have no idea why
did you turn JavaScript off, but you have to turn it on again to use my
application. I personally have no intention to make two equivalent
versions of my application: one for normal visitors, other one for few
dumb a** like you. Othervise what use JavaScript at all? So I'm affraid
this is your step to make.
</span>
</noscript>

I dend to believe that this warning text is much better.

Nov 23 '05 #4
On 21/11/2005 17:40, VK wrote:

[snip]
I personally have no intention to make two equivalent versions of my
application: one for normal visitors, other one for few dumb a** like
you.
Has it occurred to you that you're the only regular poster to this group
that actually believes that two versions would be necessary? Another
situation where you're right, and everyone else is wrong, perhaps?

You made a similar statement about a month ago, and I tried to explain
that it was nonsense then, too. Evidentially, the notion of graceful
degradation hasn't sunk in yet.

[snip]
I dend to believe that this warning text is much better.


You are clearly beyond help. It's a shame, but a situation that I,
personally, am tired of dealing with.

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Nov 23 '05 #5
VK

Michael Winter wrote:
Has it occurred to you that you're the only regular poster to this group
that actually believes that two versions would be necessary? Another
situation where you're right, and everyone else is wrong, perhaps?


Dear Michael,

First of all let me make it clear that "dumb a**" in my previous post
was totally in the context of that humorous address to some user with
JavaScript disabled and it was not anyhow addressed to the post
readers. I believe it is rather clear but I'd like to make it even more
clear.

Secondly the statement that any page has to be functional with or
without JavaScript is indeed completely false and is not covered by the
"fall gracefully" requirement. The page should not crash the browser
and user should be always informed that some or all of the page
functionality is currently not available. This is all.

I cannot think of any situations when the page with JS enabled would
provide the same or comparable user experience as the same page without
JS enabled. Maybe only some really primitive form helpers (like setting
focus to the first form field).

But I can think of many famous and prospering web services which are
not functional w/o client-side scripting.

And some services (like Google Maps and Google Suggests) *are not
reproducible* by server-side-only solutions. They need either
client-side scripting or stay-alone application.

So yes, I know that a lot of people would like to see JavaScript /
JScript on its 10-years old place: as a toy which is nice to have but
OK to leave without. There are also some people who would like to keep
historical Books Of ECMA as all explaining source of information
forever.

They may want to think again what year is now and visit
<http://www.w3.org/2006/webapi/>

P.S. I see a new urban legend is growing here recently (I traced it
back to one a month old post):-
about JavaScript disabled in corporate environment for security
measures.

Personally (so not *officially*) in 5 years spent so far in the Bay
Area plus daily visits to San Jose I did not see one damn user with
disabled JavaScript/JScript. I also did not see yet one network admin
who would disable JavaScript as a *valid security measure*. That alone
would suffice to feel free to fire his a**, as a person who has no clue
what the security is about and how to handle it.

Nov 23 '05 #6
VK

VK wrote:
I cannot think of any situations when the page with JS enabled would
provide the same or comparable user experience as the same page without
JS enabled.


A metathese obviously :-)
Must be:

I cannot think of any situations when the page with JS disabled would
provide the same or comparable user experience as the same page with JS
enabled.

Nov 23 '05 #7
VK
Just another 2 minutes fresh sample of what I'm saying:

<http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/c5b2b99752d293d1/228d5767a24608b6#228d5767a24608b6>

"you can't do this, it's server-side only"
"you can't do that, it's application only"

Big surprises are coming though... ;-)

Nov 23 '05 #8
On 21/11/2005 20:05, VK wrote:

[snip]
Secondly the statement that any page has to be functional with or
without JavaScript is indeed completely false
Would you care to venture a reason for why you think that is? Is that an
absolute statement on your part, or is there a hidden qualifier you
neglected to mention?
and is not covered by the "fall gracefully" requirement.
Yes, it is. By my definition, anyway, and the definition often (always?)
used in this group.
The page should not crash the browser
That isn't a consequence of designing for graceful degradation, that's
just competency.
and user should be always informed that some or all of the page
functionality is currently not available.
That isn't graceful. That's unmitigated failure.
[I cannot think of any situations when the page with JS disabled
would provide the same or comparable user experience as the same page
with JS enabled.]
Care to define "comparable user experience", and give an example
situation? As far as I know, "user experience" encompasses a few
qualities together: appearance, content, functionality, and usability.
If you can't think of any situations where the server cannot provide a
comparable experience, you mustn't be trying hard enough. The approach
taken will almost certainly be different and may even need to be broken
down into separate stages.

Not everything can be reproduced, but not everything needs to be.
But I can think of many famous and prospering web services which are
not functional w/o client-side scripting.
Good for them. Doesn't mean it's the right approach to take. If you
explained that the same thing could be provided to everyone, rather than
excluding some users (and potential income), I'd expect management would
agree, too.
And some services (like Google Maps and Google Suggests) *are not
reproducible* by server-side-only solutions.
Google Maps certainly can be. Movement of the map will be limited to
jumps using the controls to the top-left rather than dragging, but the
experience (as defined above) will be the same.

Google Suggests can't be, but that's one of those things that doesn't
need to be. I, and millions of others, have managed to use Google
without an auto-complete feature for years, so if Google Search
implemented this by default, it wouldn't matter if it was used or not as
long as the original behaviour was maintained.

[snip]
They may want to think again what year is now and visit
<http://www.w3.org/2006/webapi/>


Exactly what is the point you're trying to make? That the W3C are trying
to standardise some de facto and proprietary features? So what? That
doesn't mean that all users must suddenly switch to a browser that
implements client-side scripting and must enable that feature (a
ridiculous notion).

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Nov 23 '05 #9
VK

Michael Winter wrote:
Google Suggests can't be, but that's one of those things that doesn't
need to be. I, and millions of others, have managed to use Google
without an auto-complete feature for years.


This statement alone shows the difference in our *positions* over this
question and their hardware incompatibility which no discussion may
remove.

I just wondering why did you limit yourselve by *millions* of people
who managed to live w/o Google Suggests?

Not so long ago *billions* of people managed to live w/o Internet and
the world did not crash because of it.

Nov 23 '05 #10
VK said the following on 11/21/2005 12:40 PM:
Randy Webb wrote:
<noscript>
<span class="warning">I do not have a clue how to make my page work with
javascript disabled so you must come back with a script enabled browser
to see a page that probably isn't worth seeing to start with</span>
</noscript>

<noscript>
<span class="warning">
My web application is based heavily on JavaScript. I have no idea why
did you turn JavaScript off, but you have to turn it on again to use my
application. I personally have no intention to make two equivalent
versions of my application: one for normal visitors, other one for few
dumb a** like you. Othervise what use JavaScript at all? So I'm affraid
this is your step to make.
</span>
</noscript>

I dend to believe that this warning text is much better.


Nothing wrong with having a JS heavy web-app. Just make it so that
non-JS doesn't get to it without some direction action from the user.

The problem with this part of your statement:

<quote>
I personally have no intention to make two equivalent versions of my
application: one for normal visitors, other one for few dumb a** like you.
</quote>

Is that you still seem to think you have to make 2 versions of
everything when you don't.

But, if you will tell me how to enable Javascript on my non-JS Cell
Phone Browser that is under 3 months old, you may have a chance of
changing my mind about non-JS browsers.

And my cell phone is not the only place where you may run into non-JS
browsers where the user can't change the settings.

Second:
If you have to ask "Otherwise what use is Javascript at all", then you
shouldn't be using Javascript to start with.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 23 '05 #11
VK

Randy Webb wrote:
The problem with this part of your statement:
<quote>
I personally have no intention to make two equivalent versions of my
application: one for normal visitors, other one for few dumb a** like you.
</quote>
Is that you still seem to think you have to make 2 versions of
everything when you don't.
Then I must be missing the ability to read between the lines, because
the statement which caused my polemics was:

<quote>
I do not have a clue how to ***make my page work with
javascript disabled*** so you must come back with a script enabled
browser
to see a page that probably isn't worth seeing to start with
</quote>

By reading it in the conventional English I understand it as: "My page
cannot work == produce the intended user experience without JavaScript
enabled. I am a bad developer."

This leads me to a conclusion that any web solution has to be endorsed
first by a fully equivalent server-side solution (in case if the
scripting is disabled). And only then you may start to develope a
client-side based equivalent.

This leads me to the question why bother at all to make a client-side
solution is you already have a server-side one?

This leads me to the conclusion that besides some really primitive form
helpers client-side scripting should be avoided at all.

Please mark the logical failure in this sequence (if any).

My personal position is that client-side scripting is not anymore an
add-on to the browsing experince. It is an integral part of such
experience like online forms or graphics support. You can disable
JavaScript if you really want. You can disable form submission,
graphics support, CSS support, SSL support, install MS-DOS version of
Lynx, make your own browser etc. etc.
This is your freedom of choice, *but* you shouldn't bother anyone else
with your freedom issues as well as anyone should be bothered with your
ideas of self-expression.

You want to drive - you need a car. You want to play Quake - you need a
computer. You want to get an adequate browsing experience - you have to
use a standard compliant browser or IE with reasonnable security
settings. You want an omlet - you have to break the eggs.
But, if you will tell me how to enable Javascript on my non-JS Cell
Phone Browser that is under 3 months old, you may have a chance of
changing my mind about non-JS browsers.


PDA and cellphones are all different issue. The current slogan "Get the
same pages in the same way in your cellphone" is a pure propaganda from
cellphone producers. It is called "aggressive advertisement" ;-)
Many web-portals are getting slow on my test laptop 260MGz / 96Mb The
idea that anyone may manage to have full and quick emulation of say IE
6.0 on a low-energy ARMS processor with 32/64 Mb available is ...
non-adequate.
It's all the question of the crutial mass. As soon as it was reached
for GPRS cellphones, WML language and WML site development became
requested. Now any respectable web-service has a WML mirror.
Then the crucial mass of new generation of web-phones will be reached,
a scaled down, cell-phone adjusted HTML/XML version will become a must
either.

You personally just paying the price of being between the first users
of a new software / hardware. They are always paying the highest price
and they are getting all bugs, products recalls and other setup
troubles ;-)

Nov 23 '05 #12
On Mon, 21 Nov 2005 13:48:06 -0500, Michael Winter wrote
(in article <GD******************@text.news.blueyonder.co.uk>) :
On 21/11/2005 17:40, VK wrote:

[snip]
I personally have no intention to make two equivalent versions of my
application: one for normal visitors, other one for few dumb a** like
you.


Has it occurred to you that you're the only regular poster to this group
that actually believes that two versions would be necessary? Another
situation where you're right, and everyone else is wrong, perhaps?

You made a similar statement about a month ago, and I tried to explain
that it was nonsense then, too. Evidentially, the notion of graceful
degradation hasn't sunk in yet.

[snip]
I dend to believe that this warning text is much better.


You are clearly beyond help. It's a shame, but a situation that I,
personally, am tired of dealing with.


Not too tired to snipe, however.

Nov 23 '05 #13
VK wrote:
<snip>
<quote>
I do not have a clue how to ***make my page work with
javascript disabled*** so you must come back with a
script enabled browser to see a page that probably
isn't worth seeing to start with
</quote>

By reading it in the conventional English I understand
it as: "My page cannot work == produce the intended user
experience without JavaScript enabled. I am a bad developer."
Yes, where 'intended' means behaviour in accordance with the design and
sufficient for the task. Such designs are possible so it is reasonable
to question why that are not achieved when they are not achieved.
Shortcomings on the part of the developer are a reasonable hypothesis in
the absence of other information.
This leads me to a conclusion that any web solution has to
be endorsed first by a fully equivalent server-side solution
(in case if the scripting is disabled). And only then you may
start to develope a client-side based equivalent.
You seem to have a real hang-up with doing everything twice. Doing
things twice is a seriously bad idea because it is inevitably expensive.
An integrated design with a suitably layered architecture can achieve a
totally reliable design with little or no extra coding time given to
accommodating javascript incapable/disabled browsers.
This leads me to the question why bother at all to make a
client-side solution is you already have a server-side one?
You wouldn't be making a client side 'solution'. Whatever happens you
are going to need a back end of some sort to do anything worth wile so
all the client-side code was never going to be more than a GUI. HTML can
provide a workable GUI, and then client-side scripting can transform it
(in virtually any way imaginable).
This leads me to the conclusion that besides some really
primitive form helpers client-side scripting should be
avoided at all.
Only because you cannot understand how javascript can be used to
enhance, and indeed radically transform, a web page (and its GUI)
without introducing any dependency upon client-side scripting. See:-

<URL: http://www.litotes.demon.co.uk/js_info/pop_ups.html >

- with and without scripting enabled.
Please mark the logical failure in this sequence (if any).
You are looking for an excuse (any excuse) for never trying. But the
question is not how little can be gotten away with (a quick survey of
the Internet as it is will tell you that), the question of interest is
what can be achieved, and how it might best be achieved.
My personal position is that client-side scripting is not
anymore an add-on to the browsing experince.
Your opinion is of little worth. Web sites, web applications and so on,
have a purpose. As a professional developer is would be your task to
know how to best achieve that purpose. Once you know and fully
understand what can be achieved you will find yourself in the best
possible position to make informed judgements about how to achieve the
required purpose.

Your position is that if the purpose cannot be achieved without
client-side scripting running on one or two configurations or one or two
browsers what meat your personal standards then you are not going to
even try. It is a very low standard and so relatively easy for a
programmer as poor as you to achieve, but it isn't necessarily in the
best interests of whoever may be paying you for your inferior creations.
It is an integral part of such experience like online forms
or graphics support. You can disable JavaScript if you really
want. You can disable form submission, graphics support, CSS
support, SSL support, install MS-DOS version of Lynx, make your
own browser etc. etc. This is your freedom of choice, *but*
you shouldn't bother anyone else with your freedom issues as
well as anyone should be bothered with your ideas of
self-expression.
And in e-commerce how much good does it do to be laming the user for
your inability to take money off them.
You want to drive - you need a car. You want to play Quake -
you need a computer. You want to get an adequate browsing
experience - you have to use a standard compliant browser
or IE with reasonnable security settings. You want an omlet
- you have to break the eggs.
And if you want to sell things you want a shop that everyone can get
into. If you want to make money form advertising you want as many people
as possible to see those adverts, and so not only get in in the first
place but keep coming back. If you want a good search engine ranking you
want a site that can be navigated without javascript. And so on.

If the user, any user, can be accommodated at no additional cost or
effort then getting up in arms because they don't want to (or cannot)
use your preferred browser can only detract from the potential of a web
site for no good reason.
But, if you will tell me how to enable Javascript on my
non-JS Cell Phone Browser that is under 3 months old,
you may have a chance of changing my mind about non-JS
browsers.


PDA and cellphones are all different issue. The current
slogan "Get the same pages in the same way in your cellphone"
is a pure propaganda from cellphone producers. It is called
"aggressive advertisement" ;-)

<snip> You personally just paying the price of being between the
first users of a new software / hardware. They are always
paying the highest price and they are getting all bugs,
products recalls and other setup troubles ;-)


There you go again, blame the user when they suffer from your
incompetence and suggest people create yet another version of their web
site when a single version written to take advantage of the
interoperability that has been designed into the technologies used on
the web is capable of accommodating small mobile devices as easily as
desktop browsers.

Richard.
Nov 23 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Gabriel | last post: by
36 posts views Thread by Dmitriy Iassenev | last post: by
4 posts views Thread by Accolo1 | last post: by
4 posts views Thread by Marc Lawson | last post: by
9 posts views Thread by Dan W. | last post: by
3 posts views Thread by Michael Suess | last post: by
16 posts views Thread by Singulus | last post: by
4 posts views Thread by Andrey | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.