If you want to be a good scripter/programmer, it is highly suggested that you
seriously consider adding comments within your code. For one, having comments
will make it much easier for you or someone else to re-read your code. The more time that passes from when you wrote the original code
to the time you come back to revisit it, the more valuable those comments
(<!-- ... -->). The
Single-line comments start with "//". The following example shows the use of a single-line comment.
// This is an alert
// This is another alert
There may be instances where you need to add multiple-line comments to your scripts. While you could simply add double slashes at the beginning of each line, it is not as convenient. This is where the multi-line comment
tags may be used. Multi-line comments consist of the opening comment tag "/*", the comments themselves, followed by the closing comment tag
"*/".Here is an example of a multi-line comment:
/* The following two functions will result in
your browser displaying two pop-up windows.
After you click OK on the first box, the second
pop-up window will appear. */
Recommended Books & Training Resources