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.

230<br />

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

Example<br />

Use The Evaluator (Chapter 13 in the <strong>JavaScript</strong> <strong>Bible</strong>) to experiment with the<br />

charset property. To see the default setting applied to the page, enter the following<br />

statement into the top text box:<br />

document.charset<br />

If you are running IE5+ for Windows 98 and you enter the following statement,<br />

the browser will apply a different character set to the page:<br />

document.charset = “iso-8859-2”<br />

If your version of Windows does not have that character set installed in the system,<br />

the browser may ask permission to download and install the character set.<br />

characterSet<br />

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

Compatibility ✓<br />

Example<br />

Use The Evaluator (Chapter 13 in the <strong>JavaScript</strong> <strong>Bible</strong>) to experiment with the<br />

characterSet property in NN6. To see the default setting applied to the page,<br />

enter the following statement into the top text box:<br />

document.characterSet<br />

cookie<br />

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

Compatibility ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓<br />

Example<br />

Experiment with the last group of statements in Listing 18-3 to create, retrieve,<br />

and delete cookies. You can also experiment with The Evaluator by assigning a<br />

name/value pair string to document.cookie, and then examining the value of the<br />

cookie property.<br />

defaultCharset<br />

document.defaultCharset<br />

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

Compatibility ✓ ✓ ✓

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

Saved successfully!

Ooh no, something went wrong!