How to hide JavaScript comments in the resulting HTML page? [closed]

Is there a way to hide the JS comments on the resulting page source? The JS is generic...




Sure. Just minify your javascript with a tool like JSMin:

Or UglifyJS: Or Google Closure:

They all strip comments and excess whitespace. Some will even change your variable names in crazy ways to save bytes.

Or write your JS in a compile to JS language like coffee script which strips out comments at compile time.


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.