Click to See Complete Forum and Search --> : Comment tags for older browsers


Norman Graham
05-13-2003, 02:46 AM
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.<!--
//-->
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

Alex
05-13-2003, 03:00 AM
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!

Norman Graham
05-13-2003, 05:26 AM
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 :D

Charles
05-13-2003, 05:27 AM
My 3rd edition of The Rhino, 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.