/    Sign up×
Community /Pin to ProfileBookmark

Comment tags for older browsers

I notice that it seems to be standard practice to comment out JS script in the dochead so that it will be ignored by older browsers, i.e.

[CODE]<!–
//–>[/CODE]

This isn’t mentioned even once in my book (O’Reilly, Definitive Guide, 4th Ed.), or at least I can’t find it, and the examples never use it. From which generation of browsers is this no longer necessary? Is it likely that anyone is actually using a browser which can’t interpret JS at all? Are these comment tags now, in fact, obsolete?

Thanks for your help

Norman

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@AlexMay 13.2003 — Hi Norman,

within selfhtml (german only) they only write that it should still be handled as mentioned by you:

http://www.netzwelt.com/selfhtml/javascript/intro.htm#javascriptbereiche

I assume that all version above IE4.0 and NS3.5 support JavaScript. Most of the webusers (>95%) use a browser version that interpretes JavaScript. So it´s up to you to whether you use this comments or not.

Hope this helps!
Copy linkTweet thisAlerts:
@Norman_GrahamauthorMay 13.2003 — Thanks for that, Alex. The German site is very good - excellent simplicity and clear structuring for beginners. I've added it to my favourites. Manchmal ist es eben doch von Vorteil, Deutsch sprechen zu koennen.

Norman ?
Copy linkTweet thisAlerts:
@CharlesMay 13.2003 — [font=georgia]My 3rd edition of [i]The Rhino[/i], as that book from O'reilly is known discusses the matter in section 19.3.1 and on page 352.

It's more like 87% of users that do not use JavaScript (http://www.thecounter.com/stats/2003/May/javas.php) and because some people cannot use JavaScript because of their disabilities it is very important to not rely upon JavaScript. However, most every one of the browsers that are not running JavaScript know about nonetheless. It might just be time to stop using those comments.[/font]
×

Success!

Help @Norman_Graham spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...