Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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?

irt.org | Knowledge Base | JavaScript | Misc | Q1535 [ previous next ]

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?

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.


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.