Test Your Knowledge

  1. Which tags do you use to enclose JavaScript code?

  2. By default, to which part of a document will JavaScript code output?

  3. How can you include JavaScript code from another source in your documents?

  4. Which JavaScript function is the equivalent of echo or print in PHP?

  5. How can you create a comment in JavaScript?

  6. What is the JavaScript string concatenation operator?

  7. Which keyword can you use within a JavaScript function to define a variable that has local scope?

  8. Give two cross-browser methods to display the URL assigned to the link with an id of thislink.

  9. Which two JavaScript commands will make the browser load the previous page in its history array?

  10. What JavaScript command would you use to replace the current document with the main page at the http://www.oreilly.com website?

See Chapter 13 Answers in Appendix A for the answers to these questions.

Get Learning PHP, MySQL, JavaScript, and CSS, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.