Skip to Main Content
Head Rush Ajax
book

Head Rush Ajax

by Brett McLaughlin
March 2006
Beginner to intermediate content levelBeginner to intermediate
448 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Head Rush Ajax
you’re on your way 4
257
developing dom apps
div
div
img
img
img
img
img
body
div
The <img> element is now under
the “top5” <div>, and will show
up on the bottom of the page.
After addToTop5() runs for
the rst CD clicked, the
DOM tree should look like this.
When the <img> element is moved, it’s no longer
underneath the “cds” <div>. That means that it
“disappears” from the top of the page.
form
div
h2
When someone clicks on a CD cover image, addToTop5() will run. We
want that JavaScript function to take the <img> element that was clicked
on, and move it from the “cds” <div> to the “top5” <div>. Here’s what
the end result should look like:
After addToTop5() runs...
brain
power
What do you think will happen to the web page when the <img>
element is moved from the “cds” <div> to the “top5” <div>?
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
Head First Ajax

Head First Ajax

Rebecca M. Riordan

Publisher Resources

ISBN: 0596102259Errata PageSupplemental Content