JavaScript Tutorial/Language Basics/Comments

Материал из Web эксперт
Перейти к: навигация, поиск

Hide scripts using comments

   <source lang="javascript">

<html> <head> <title>Hide scripts using comments.</title> <script language="javascript" type="text/javascript">

</script> </head> <body> Page content here... </body> </html></source>


Multiline comments

/* */ enables comments to span multiple lines.



   <source lang="javascript">

<html> <head> <title>A Simple Page</title> <script language="javascript">

</script> </head> <body> </body> </html></source>


Single line comments

The // comment tag enables comments to be placed between the // and the end of the line.



   <source lang="javascript">

<html> <head> <title>A Simple Page</title> <script language="javascript">

</script> </head> <body> </body> </html></source>