[an error occurred while processing this directive]

Exercise : Address Book, Client-Side (by Alex Miller)

screenshot

Write the JS code to connect to a server-side JSON address book called addressbook.php. Start from this HTML. (sample solution) (solution)

Exercise : Garbage Collector (by Morgan Doocy)

screenshot

Write the necessary JavaScript code to add effects and drag-and-drop behavior to a page. Start from this HTML/JS. (sample solution) (Prototype solution code) (jQuery solution code)

Use Prototype/Scriptaculous or jQuery to add the effects and drag-and-drop behavior.

Exercise : Photo Gallery (by Sylvia Tashev)

Write an animated photo gallery using Scriptaculous. Start with the skeleton HTML and CSS. Click the image to run our sample solution: (solution JS code gallery.js):

expected output

Right now, when you double-click an image, it shows in the large mainimage area. But it's boring! Add Scriptaculous effects such as the following...

Exercise : Photo Gallery

  1. When the page first loads up, the thumbnail of the current mainimage image (the first one) should scale up to 200% of its normal size, and the mainimage image should have a visual effect, such as shaking.
  2. When the user double-clicks a thumbnail to show a new image, the same effects as just described should occur. The new thumbnail should grow to 200% size, and the mainimage image should shake as it changes. Also the old selected thumbnail should shrink back to its previous size. Note that if you double-click on the same thumbnail twice in a row, it shouldn't break.
  3. When the previous/next, left/right arrows are clicked, the corresponding previous or next image should be placed into the large area. It should be as though the user double-clicked on the previous or next thumbnail, complete with the same effects.

Exercise : Photo Gallery

  1. Make the list of images so that its order can be rearranged by dragging the images left and right. See the Scriptaculous wiki page for ideas and options such as tag and constraint.
  2. Make it so that when the user drags a thumbnail image to the mainimage area, the large image will update. (This is the same behavior as when the thumbnail is double-clicked. See the Scriptaculous Wiki pages about dragging and dropping.
  3. If you finish the previous effects, add other bling to the page. For example, when the images are rearranged by dragging them to sort them, make effects occur on the affected thumbnails. Or add sequences of effects that occur on the same element; for example, when the large mainimage is updated, make it have two effects in a row, such as highlighting and then shaking.

Exercise Photo Gallery

You can view the solution javascript here.

Exercise : Address Book, Server-Side (by Alex Miller)

screenshot

Write the PHP code to manage an address book using JSON. You are given the HTML and JS. The JS code sends requests to your addressbook.php web service that reads and saves address data. (sample solution) (solution) Write the PHP file, addressbook.php, that provides the following behavior:

You may assume that any necessary parameters are passed and are in valid formats.

Exercise : Prime Factors XML (by Eli White)

Write a PHP web service factors-xml.php that computes and outputs prime factorization of integers as XML. (sample solution) (solution code) Provide the following behavior:

Exercise : Prime Factors JSON (by Eli White)

Write a PHP web service factors-json.php that computes and outputs prime factorization of integers as JSON. (sample solution) (solution code) Provide the following behavior:

[an error occurred while processing this directive]