1137Chapter 42 (Web design seattle) .Global Functions and Statements Statements //
1137Chapter 42 .Global Functions and Statements Statements // /*…*/ NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . . Comments are statements that the JavaScript interpreter (or server-side compiler) ignores. However, these statements enable authors to leave notes about how things work in their scripts. While lavish comments are useful to authors during a script s creation and maintenance, the full content of a client-side comment is downloaded with the document. Every byte of non-operational content of the page takes a bit more time to download. Still, I recommend lots of comments particularly as you create a script. JavaScript offers two styles of comments. One style consists of two forward slashes (no spaces between them). JavaScript ignores any characters to the right of those slashes on the same line, even if they appear in the middle of a line. You can stack as many lines of these single-line comments as is necessary to convey your thoughts. I typically place a space between the second slash and the beginning of my comment. The following are examples of valid, one-line comment formats: // this is a comment line usually about what s to come var a = Fred // a comment about this line // You may want to capitalize the first word of a comment // sentence if it runs across multiple lines. // // And you can leave a completely blank line, like the one above. For longer comments, it is usually more convenient to enclose the section in the other style of comment. The following comment opens with a forward slash and asterisk (/*) and ends with an asterisk and forward slash (*/). JavaScript ignores all statements in between including multiple lines. If you want to comment out briefly a large segment of your script for debugging purposes, it is easiest to bracket the segment with these comment symbols. To make these comment blocks easier to find, I generally place these symbols on their own lines as follows: /* some commented-out statements */ If you are developing rather complex documents, you might find using comments a convenient way to help you organize segments of your scripts and make each // (comment)
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.