This assignment asks you to create a function that swaps one image with another and opens a new window to a given URL. The function takes three parameters: the name of an image to swap, the URL of a new image to put in its place, and a URL to open in the new window.

<html><head><title>Chapter 6 Assignment</title> <script type = "text/javascript"> <!-- hide me from older browsers // function fancySwap() takes three parameters: // 1. the web page image that's getting swapped out // 2. the filename of an image to swap into the web page image // 3. a URL to open into a new window // function fancySwap(the_image, new_image, the_url) { the_image.src = new_image; var my_window = window.open(the_url, my_window, "height=300,width=150"); } // show ...

Get The Book of JavaScript, 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.