November 2014
Beginner
336 pages
10h 58m
English
You’ve just created your first web page. Now let’s make the page a little more interactive. Create another file in your kittenbook directory called kittenbook.js. This will be a JavaScript file, and it will make your web page more interesting.
Open kittenbook.js with your text editor and fill it with the code in Listing 1.3.
Listing 1.3 Hello, Friend!
alert('Hello, [your name]!');
Replace [your name] with your real name. For me, this would be alert('Hello, Steven!').
Now open your web page again (or reload it) and see what happens. It’s a trick! The page should look exactly the same as it did before. The HTML doesn’t know that the JavaScript exists, and that’s because we didn’t tell the HTML ...
Read now
Unlock full access