Page 9/10 in Headfirst Javascript features a neat starter exercise. On page 9, they show a page of code with a few sections circled, and prompt you to write what you think those things are (to prove that JavaScript really isn't all that scary and a lot of it is common sense). For instance...
function validateZIPCode (value) {...means enter a zip code with five digits (page 10 fills me in on this answer.)
// Validate the ZIP code
// if (!isZIPCODE (value))
alert("Please enter a ZIP code in the form XXXXX.")
I guessed it meant "enter a zip code, and if it is a certain value, validate it." Close, but not quite.
Lower down the page, another section is circled...
onclick="findHouses(this.form);Except, on page 10 there is no answer for what this means. The wrong section is highlighted, so I still don't know what onclick="findHouses(this.form);" means. I guess I will have to keep reading and learning to find out.
No comments:
Post a Comment