Ok, so I loaded ch1_examp1.htm in my browser, and it worked like the book said.
But ch1_examp2.htm is acting odd. When I load it, it makes everything red, but it will show the script block "Second Script Block" without showing the first one. And the text on the page says:
Paragraph 1
// Script block 1 alert("First Script Block");
Paragraph 2
When I click OK will display Paragraph 3 on the page along with the other paragraphs. I am running Firefox 28.0 . Here is the code that I typed:
Code:
<html>
<body bgcolor="WHITE">
<p>Paragraph 1</p>
</script type="text/javascript">
// Script block 1
alert("First Script Block");
</script>
<p>Paragraph 2</p>
<script type="text/javascript">
// Script Block 2
document.bgColor = "RED";
alert("Second Script Block");
</script>
<p>Paragraph 3</p>
</body>
</html>
Also, I am using Notepad++ if that makes any difference.