COM271, Week 9

JavaScript Programming

Syllabus | Table of Pages | Assignments | References and Useful Links
←Review, Week 8 | Review, Week 10→

Answer these questions by reviewing the notes for week 9.

  1. State one compelling reason to use javascript for client-side form validation.
  2. State one compelling reason to use a server-side technology for form validation.
  3. Define global scope.
  4. Define local scope.
  5. For the following code, what values of "X1" and "X2" appear in the alert boxes?
    <script>
    function gofigure()
    {
    x=2;
    doubleit(x);
    alert('X2 = '+x);
    }

    function doubleit(x)
    {
    x=x*2;
    alert('X1 = '+x);
    }
    </script>

    Hint: After you've thought this through, Try it!, then go back and rethink, if necessary.
  6. Given images rollover1.jpg and rollover2.jpg, write a line of html using javascript to create a graphics-based menu item with a rollover effect? (2 points, one for mouse over and one for mouse off.)
  7. Create a regular expression pattern and assign it to a variable, then use the variable (and its .test method) to determine whether a string contains the characters ".org" (requires at least 2 statements of code).
  8. Write a combination of html, javascript, and css to create a remote rollover effect (roll over image here to create dynamic effect there); an example of a rollover effect would be a change in text color or background color. Before submitting your answer, actually code this so that you know that it works. (3 points)

These questions are worth points as indicated; Total points this review = 10. At the end of the course, total points will be added, divided by 100, and that fraction will be applied to 20% of your grade (maximum points from reviews is 20% of grade). See Assignments and Grading.