Christian Johansen wrote:As I've already said, doing so isn't necessary. But if you absolutely want to, your second example will work. However, keep in mind that if you're using a JavaScript library such as jQuery, your code will break in old browsers anyway. Not in those archaic browsers that don't support JavaScript at all, but slightly newer browsers such as IE 5.5. So unless you're including some very basic JavaScript, chances are that the comments will protect your site from crashing in e.g. Netscape 2, but the site will still (probably) fail in Firefox 1, IE 5.5, Safari 2 and others, for other reasons.
Actually i have to incorporate all the browsers. You are right today that is not neccessary. But i want to do it as an learning exercise. Can you explain how commenting works in following code
It will be great help.