Test Your Knowledge: Questions

Question 14-1

Which tags do you use to enclose JavaScript code?

Question 14-2

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

Question 14-3

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

Question 14-4

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

Question 14-5

How can you create a comment in JavaScript?

Question 14-6

What is the JavaScript string concatenation operator?

Question 14-7

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

Question 14-8

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

Question 14-9

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

Question 14-10

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

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

Get Learning PHP, MySQL, and JavaScript 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.