473,387 Members | 1,669 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,387 software developers and data experts.

how universally enabled is Javascript?

Hi everyone,

I've just started adding JavaScript to some of my web pages. It then
occurred to me that of course not everyone may have JavaScript in their
browser and more probably may have JavaScript disabled for security reasons
(particularly on machines within a company network).

So my questions are,
1: is there any estimate available of the percentage of users not having
JavaScript available to them,
2: how much effort is worth putting into <noscript>......</noscript>
alternatives,
3: could someone recommend a guide (online or book) to writing JavaScript so
it gracefully degrades when not available.

Many thanks to you all,

John
Nov 29 '06 #1
11 1452
John Pote wrote:
Hi everyone,

I've just started adding JavaScript to some of my web pages.
It then occurred to me that of course not everyone may have
JavaScript in their browser and more probably may have
JavaScript disabled for security reasons (particularly on
machines within a company network).

So my questions are,
1: is there any estimate available of the percentage of users
not having JavaScript available to them,
There are lots. Some even resemble each other.
2: how much effort is worth putting into <noscript>
......</noscriptalternatives,
None, NOSCRPT elements are of close to no use in dealing with the
consequences of javascript being disabled as javascript being disabled
is not the only condition in which scripts may not be able to act, and
so not the only condition for which designed fall-back is required (and
whatever suites the condition where scripting is available but cannot do
what it wants to do also suites the conditions where scripts cannot
execute at all).
3: could someone recommend a guide (online or book) to writing
JavaScript so it gracefully degrades when not available.
Possibly, but there will not be many. Searching the archives of
comp.lang.javascript would probably turn up the most direct
consideration of the subject.

Richard.
Nov 29 '06 #2
ASM
John Pote a écrit :
1: is there any estimate available of the percentage of users not having
JavaScript available to them,
It's said about 10%
2: how much effort is worth putting into <noscript>......</noscript>
alternatives,
I think JS would have to be only in overlay, so noscript has no utility:
a "normal" page must work without JS, this last one bringing some
features not indispensable (decoration, help in forms ...)
3: could someone recommend a guide (online or book) to writing JavaScript so
it gracefully degrades when not available.
<a href="page.htm"
onclick="window.open(this.href);return false;">page</a>

If JS enabled the file 'page.htm' will be open in a new window,
if disabled the page is opened in same window.

An other way (not allowed in 'strict' where target is forbidden)
This time you'll get a new window (JS or not) :

<a href="page.htm" target="here"
onclick="window.open('','here','width=400');">page </a>

--
Stephane Moriaux and his less old Mac already out of date
Nov 29 '06 #3
Hi John,

John Pote wrote:
>
3: could someone recommend a guide (online or book) to writing JavaScript so
it gracefully degrades when not available.
A big part of the puzzle is feature detection
http://www.jibbering.com/faq/faq_not...er_detect.html

It seems like many people on comp.lang.javascript are very concerned
with graceful degredation and I have been learning as much as I can so
I can make more informed decisions. There are many other developers out
there that don't care a bit. If it works on IE6+, FF1.5+, Opera8+,
Safari2+ then many are happy and have happy clients and all is well
with their worlds. I spent a lot of time thinking about degradation and
a while ago spewed some text about it
http://peter.michaux.ca/article/81 that is not definitive by any
stretch but may provoke thought.

The biggest problem seems to come when a branch of JavaScript starts
executing and once started must run to completion successfully. Suppose
that you rearrange the visual appearance of a page and hide certain
parts. If the browser won't let the person then make those hidden parts
reappear all is lost. So before rearranging the page you must make sure
the whole thing will work. The rearranging needs gateway tests before
starting to ensure the browser can handle everything required.

Here is an example on Richard's page that I found useful in
understanding some of the issues.

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

Peter

Nov 29 '06 #4
ASM said the following on 11/28/2006 8:53 PM:

<snip>
An other way (not allowed in 'strict' where target is forbidden)
This time you'll get a new window (JS or not) :

<a href="page.htm" target="here"
onclick="window.open('','here','width=400');">page </a>

<a href="page.htm" target="here"
onclick="window.open('',this.href);">page</a>

<g>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 29 '06 #5

John Pote wrote:
So my questions are,
1: is there any estimate available of the percentage of users not having
JavaScript available to them,
http://www.thecounter.com/stats/2006/November/javas.php

Nov 29 '06 #6
Randy Webb wrote on 29 nov 2006 in comp.lang.javascript:
ASM said the following on 11/28/2006 8:53 PM:

<snip>
>An other way (not allowed in 'strict' where target is forbidden)
This time you'll get a new window (JS or not) :

<a href="page.htm" target="here"
onclick="window.open('','here','width=400');">page </a>


<a href="page.htm" target="here"
onclick="window.open('',this.href);">page</a>
href position in window.open() is the first argumaent!

<a href="page.htm" target="here"
onclick="alert(window.open(this.href,this.target); "
>page</a>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 29 '06 #7
Evertjan. said the following on 11/29/2006 3:35 AM:
Randy Webb wrote on 29 nov 2006 in comp.lang.javascript:
>ASM said the following on 11/28/2006 8:53 PM:

<snip>
>>An other way (not allowed in 'strict' where target is forbidden)
This time you'll get a new window (JS or not) :

<a href="page.htm" target="here"
onclick="window.open('','here','width=400');">page </a>

<a href="page.htm" target="here"
onclick="window.open('',this.href);">page</a>

href position in window.open() is the first argumaent!

<a href="page.htm" target="here"
onclick="alert(window.open(this.href,this.target); " >
page</a>
Oops!

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 29 '06 #8
Randy Webb wrote on 29 nov 2006 in comp.lang.javascript:
>><a href="page.htm" target="here"
onclick="window.open('',this.href);">page</a>

href position in window.open() is the first argumaent!

<a href="page.htm" target="here"
onclick="alert(window.open(this.href,this.target) ;" >
page</a>

Oops!
Sorry, I don't know what my alert( does there!

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 29 '06 #9
ASM
Randy Webb a écrit :
Evertjan. said the following on 11/29/2006 3:35 AM:
>Randy Webb wrote on 29 nov 2006 in comp.lang.javascript:
>>ASM said the following on 11/28/2006 8:53 PM:

<snip>

An other way (not allowed in 'strict' where target is forbidden)
This time you'll get a new window (JS or not) :

<a href="page.htm" target="here"
onclick="window.open('','here','width=400');">page </a>

<a href="page.htm" target="here"
onclick="window.open('',this.href);">page</a>

href position in window.open() is the first argumaent!

<a href="page.htm" target="here"
onclick="alert(window.open(this.href,this.target) ;" >
page</a>

Oops!
Y a des fois où je me demande ... :-(

There's times I ask myself "did they read or not ?"

and I do say :
this.href in window.open() is not necessary in my example up there
because same target is declared (in html and in JS).

Please don't try to bad correct what is OK (and quite simple).
How could understand and what will remember a newbie reading your comments ?
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Nov 29 '06 #10
ASM said the following on 11/29/2006 12:52 PM:
Randy Webb a écrit :
>Evertjan. said the following on 11/29/2006 3:35 AM:
>>Randy Webb wrote on 29 nov 2006 in comp.lang.javascript:

ASM said the following on 11/28/2006 8:53 PM:

<snip>

An other way (not allowed in 'strict' where target is forbidden)
This time you'll get a new window (JS or not) :
>
<a href="page.htm" target="here"
onclick="window.open('','here','width=400');">page </a>

<a href="page.htm" target="here"
onclick="window.open('',this.href);">page</a>

href position in window.open() is the first argumaent!

<a href="page.htm" target="here"
onclick="alert(window.open(this.href,this.target );" >
page</a>

Oops!

Y a des fois où je me demande ... :-(

There's times I ask myself "did they read or not ?"

and I do say :
this.href in window.open() is not necessary in my example up there
because same target is declared (in html and in JS).
Is there somewhere that it is documented that giving window.open '' as
the href should cause the UA to use the href of the current link? I
don't think there is. It is a better, safer practice to specify the href
attribute and this.href does that without having to code it in two places.
Please don't try to bad correct what is OK (and quite simple).
Did you test your code? Without a return false in the onclick you should
get a new window and the parent window navigates to the href attribute.
How could understand and what will remember a newbie reading your
comments ?
What the link should look like is something like this:

<a href="page.htm" target="here"
onclick="window.open(this.href,this.target);return false"
>
page</a>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 29 '06 #11
Randy Webb wrote on 29 nov 2006 in comp.lang.javascript:
Did you test your code? Without a return false in the onclick you should
get a new window and the parent window navigates to the href attribute.
>How could understand and what will remember a newbie reading your
comments ?

What the link should look like is something like this:

<a href="page.htm" target="here"
onclick="window.open(this.href,this.target);return false"
>
page</a>
Testing is not that easy,
since this will run nicely,
though not as expected:

<a href="donquijote.htm" target="here"
onclick="windmill.open(this.href,this.target);retu rn false"
>Don Quijote</a>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 29 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: confused | last post by:
After expressing my interest in expanding my new knowledge of HTML and CSS into the wild realm of JavaScript, I was advised that it is wiser to avoid it, since not all browsers are use it or are...
25
by: Ryan Stewart | last post by:
I'm working on a project to collect web application usage statistics. What are the recommended ways of detecting whether a browser is JavaScript enabled and/or capable? Obviously I can write a...
5
by: Christian Ista | last post by:
Hi, Is it possible to check if the javascript is turn on on the browser (IE, firefox, ...)? Thanks, Christian,
13
by: Alex Molochnikov | last post by:
Is there any way to find out programmatically if Javascript is supported/enabled in a browser? By "programmatically" I mean on the Java servlet side. TIA Alex Molochnikov Gestalt Corporation
5
by: Leo J. Hart IV | last post by:
Hello, I'm hoping someone can help me out. I was wondering if the Enabled property of a CheckBox or RadioButton server control is stored in the ViewState. If not, is there some way to to add...
10
by: David Thielen | last post by:
Hi; When a user clicks a radio button, what I would like to do is that if javascript is enabled on their browser, it calls a javascript function and does not do a postback. If javascript is...
6
by: Jim | last post by:
How do I check if javascript is enabled in PHP? TIA, Jim
18
by: damezumari | last post by:
I would like to know how many of the visitors to my site has js enabled and how many has it turned off. I haven't found a simple solution searching Google groups so I suggest the following using...
12
by: Anic297 | last post by:
Hi, This is certainly a simple question, but I'm a newbie in JavaScript. Is there a way to know if JavaScript is enabled? My php script uses JavasSript to do something. If JavaScript is not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.