My wish is your command – Head First Ajax
this is a new chapter 283 manipulating the DOM. 7. My wish is your command. Sometimes you just need a little mind control. It’s great to know that web browsers …
It’s great to know that web browsers turn your XHTML into DOM trees. And you can do a lot by moving around within those trees. But real power is taking control of a DOM tree and making the tree look like you want it to. Sometimes what you really need is to add a new element and some text, or to remove an element, like an , from a page altogether. You can do all of that and more with the DOM, and along the way, banish that troublesome innerHTML property altogether. The result? Code that can do more to a page, without having to mix presentation and structure in with your JavaScript.
All the cool kids have been playing the Fifteen Puzzle you developed for Webville Puzzles. The company’s been making so much on subscription fees that they want a new puzzle… and they’ve come to you to build the interactivity.
This time, the company wants something a little more educational: Woggle, an online word generation game. They’ve already built the XHTML, and even know exactly how they want the puzzle to work.
There’s a lot to build to get Woggle working, and of course the company wants their new app working immediately. Before you dig into the XHTML and CSS, think about what tasks are involved, and what JavaScript each one will need.Try and list each basic task for which you’ll need to write code, and then make notes about what tools and techniques you might use for that task.
Your job was to figure out the basic tasks we’d need to take care of to get Woggle working. Here’s what we came up with. You might have some differences in your details, but make sure you got these same core ideas down in some form or fashion.
Download My wish is your command – Head First Ajax.pdf