Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q1535 Is it necessary to hide JavaScript code contained in .js source files using the <!-- //--> characters around all the script found in an external file?

You are here: irt.org | FAQ | JavaScript | Misc | Q1535 [ previous next ]

The comments in a script serves one purpose only, to hide the script from browsers that do not recognise the script tag - ancient browsers and some newer ones perhaps (pda minibrowsers - but they really should ignore what is between script tags)

Browsers that do not recognise or handle script tags certainly do not know about js files and therefore any script in js files needn't be commented out.

©2018 Martin Webb