CS332a Advanced HTML Programming

Review for First Quiz: Chapters 19 and 20, and online material

  1. What are some differences between Java and JavaScript? Which is compiled? Which is interpreted?

  2. What tags are required to create a JavaScript? What tags are not required, but are recommended to keep old browsers from crashing?

  3. In general where would you expect to find JavaScript commands?
    1.  In the head section of a page
    2.  In the body section of a page
    3.  Inside certain tags
    4.  Running on a server

  4. What is wrong with this script framework?
    <script language="JavaScipt">
    <!-- a remark is placed here, enclosing the script commands
    // a remark in the script is created with double slashes
    / this is another remark in the script -->

  5. How can you run a script that is not actually typed in the HTML page?
    1.  use a RUN command
    2.  use a function call
    3.  access the Script() object
    4.  use the SRC attribute of a script tag

  6. What is the proper notation to set the value of a property of an object?
    1. object(property) = value
    2. object.property = = value
    3. object.property eq value
    4. object.property = value

  7. What is the difference between a method and a function?

  8. Name three events that could take place on a web page involving a mouse.

  9. Assume the following line of code is in a script. What does it do? Explain the purpose of each part of the instruction
    onClick="document.bgcolor='blue' "

  10. How do you create a variable in a JavaScript program? What keyword is used to create it?

  11. How do you create a function in a JavaScript program? What keyword is used to create it?

  12. What is wrong with the function structure below?
    <script language="JavaScript">
    function functionName (arguments)
    { program instructions go here

  13. What JavaScript keyword is used to allow branching in a program?

  14. If you use a document.write() command to create a link on a page, why might you need to use both single and double quotes in it?

  15. What function might be used to create a warning box for the reader of your page?

  16. An object is something that is held in memory. What does the document object represent? What does the window object represent?

  17. When an error message appears, it may have a line number in it. To find the line the error message mentions, do you count down from the top of the page or the top of the script?

  18. What is a return value?

  19. How do you get the write() method to put the value stored in a variable on your page?

  20. What is the difference between an event and an event handler? Write a line of code and use it to explain the difference.

  21. Where do semicolons appear in JavaScript commands?