View Full Version : Does JS still need to hidden with comment tags?
dreuby
09-19-2002, 09:11 AM
I copied some JavaScript recently for an affil sceme, and noticed that it didn't have the usual comments tag to hide it from older browsers.
Should I add them - or are all browsers now OK with JS? Can I remove the comments surrounding all my other JS scripts?
BoR|S
09-19-2002, 09:33 AM
My opinion (TM), keep them, you can never know if someone still uses an old browser, so better make something that everyone will be able to see...
Delicates
09-19-2002, 04:32 PM
You can remove them.
Unless your page gets viewed a lot by people using browsers created 10 years ago.
Up to you, but I preffer not to include them.
Waves
09-19-2002, 06:18 PM
Unless you want to risk being accused of stealing someones script, leave the tags in. Better safe than sorry
Delicates
09-19-2002, 06:51 PM
Originally posted by Waves
Unless you want to risk being accused of stealing someones script, leave the tags in. Better safe than sorry
BoR|S
09-20-2002, 01:58 AM
LOL!
"Better safe than sorry" -- sounds like some kind of Durex or R3 ad :D
dreuby
09-26-2002, 03:12 AM
Originally posted by Waves
Unless you want to risk being accused of stealing someones script, leave the tags in. Better safe than sorry
Didn't make myself quite clear on my original post - it's the JS that the affil scheme owner supplies that I copied. That's why I didn't want to make any changes - but I don't want my site to crash any older browsers, either!
EnwTheGood
09-26-2002, 07:08 PM
According to thecounter.com/stats, less than 700 people out of 311068650 used browsers incompatible with JavaScript. That's one out of every 4.4 million viewers.
So save a few bytes on your web server and take the comments out. No one will notice the difference.
(BTW, don't trust thecounter.com's javascript totals; Netscape <4.5 and MSIE <= 3.0 report "false" to thecounter.com)
EnwTheGood
09-27-2002, 04:28 AM
Yes, but for the matter at hand, it won't matter whether JavaScript is enabled or disabled.
Even if its disabled in your browser, as long as the browser supports JS, it will notice the <script> tags.
So, the amount of people that this actually matters for is the people running Netscape 1.0 or MSIE 1.0 or 2.0, of which there is a very small amount.
dreuby
09-29-2002, 07:51 AM
Originally posted by dbindel
You might as well leave the comments tags in for backword compatibility. I understand that you copied it from an "affil scheme".... exactly what is an affil scheme? Sorry if I sound stupid, but I just don't know.
I'm an affiliate for several products (mainly e-books) that I sell on my website along with my own. I can never remember the proper name for these marketing thingies!
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.