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.

246<br />

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

Listing 18-13 (continued)<br />

<br />

<br />

<br />

document.createStyleSheet() Method<br />

<br />

<br />

&nbsp;<br />

<br />

<br />

Section 1<br />

Lorem ipsum dolor sit amet, consectetaur adipisicing elit,<br />

sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.<br />

Ut enim adminim veniam, quis nostrud exercitation ullamco laboris<br />

nisi ut aliquip ex ea commodo consequat.<br />

Section 2<br />

Duis aute irure dolor in reprehenderit involuptate velit esse<br />

cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat<br />

cupidatat non proident, sunt in culpa qui officia deseruntmollit<br />

anim id est laborum.<br />

<br />

<br />

createTextNode(“text”)<br />

document.createTextNode()<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓<br />

Example<br />

While Chapter 14 and 15 of the <strong>JavaScript</strong> <strong>Bible</strong> (Listing 15-21 in Chapter 1, for<br />

instance) provide numerous examples of the createTextNode() method at work,<br />

using The Evaluator (Chapter 13 in the <strong>JavaScript</strong> <strong>Bible</strong>) is instructive to see just<br />

what the method generates in IE5+ and NN6. You can use one of the built-in global<br />

variables of The Evaluator to hold a reference to a newly generated text node by<br />

entering the following statement into the top text field:<br />

a = document.createTextNode(“Hello”)

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

Saved successfully!

Ooh no, something went wrong!