23.04.2013 Views

javascript

javascript

javascript

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 10 ■ SCRIPTING BOM<br />

<br />

ten.html<br />

images/lunaracer.jpg<br />

Nike LunaRacer<br />

<br />

<br />

ten.html<br />

images/glide_bos.jpg<br />

Nike Lunar Glide, Boston<br />

<br />

<br />

ten.html<br />

images/glide_nyc.jpg<br />

Nike Lunar Gllide, NYC<br />

<br />

<br />

ten.html<br />

images/mariah.jpg<br />

Nike Mariah<br />

<br />

<br />

ten.html<br />

images/fly_org.jpg<br />

Nike Lunar Fly, Orange<br />

<br />

<br />

ten.html<br />

images/fly_blk.jpg<br />

Nike Lunar Fly, Black<br />

<br />

<br />

ten.html<br />

images/elite.jpg<br />

Nike Lunar Elite<br />

<br />

<br />

ten.html<br />

images/vomero.jpg<br />

Nike Zoom Vomero<br />

<br />

<br />

ten.html<br />

images/max.jpg<br />

Nike Air Max<br />

<br />

<br />

We’ll use this data in a second scroller below the one we created in the previous example. The first<br />

thing we need to do is move the prep() invocation from parseHTML() to parseXML(), replacing it with a<br />

call to getData() for data/s3.xml. Doing so ensures the two new scrollers are in the DOM tree prior to<br />

JavaScript running prepSprites() and prepScrollers().<br />

function parseHTML(req) {<br />

if (req.status === 200 || req.status === 304) {<br />

433

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!