Is there a way to hide the JS comments on the resulting page source? The JS is generic…
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sure. Just minify your javascript with a tool like JSMin: http://www.crockford.com/javascript/jsmin.html
Or UglifyJS: https://github.com/mishoo/UglifyJS/
Or Google Closure: https://developers.google.com/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 http://coffeescript.org/ which strips out comments at compile time.