15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

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.

228<br />

<strong>JavaScript</strong> <strong>Examples</strong> <strong>Bible</strong>: The Essential Companion to <strong>JavaScript</strong> <strong>Bible</strong><br />

Listing 18-2: Reading the Number of Anchors<br />

<br />

<br />

document.anchors Property<br />

<br />

function goNextAnchor(where) {<br />

window.location.hash = where<br />

}<br />

<br />

<br />

<br />

document.anchors<br />

Top<br />

<br />

<br />

<br />

<br />

Section 1<br />

<br />

<br />

<br />

<br />

Section 2<br />

<br />

<br />

<br />

<br />

Section 3<br />

<br />

<br />

<br />

<br />

<br />

document.write(“There are “ + document.anchors.length +<br />

“ anchors defined for this document”)<br />

<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!