January 2001
Beginner
312 pages
6h 4m
English
Professional JavaScripters strive to make it easy to reread their code when they come back to it (maybe many months later). One of the things they use to help them is the JavaScript comment tags, one of which you've already come across in the previous chapter—the single-line comment.
Here is an example of single-line comment tags in action:
<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!-- Cloaking device on!
// The first alert is below
alert("An alert triggered by JavaScript!");
// Here is the second alert
alert("A second message appears!");
// Cloaking device off -->
</script>
</head>
<body>
</body>
</html>
If you run this JavaScript, you won't notice any difference ...
Read now
Unlock full access