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.

Chapter 12 ✦ Navigator and Other Environment Objects (Chapter 28)<br />

form.doc_all.value = isDocAll()<br />

form.doc_w3c.value = isDocW3C()<br />

}<br />

<br />

<br />

<br />

About This Browser<br />

<br />

Brand<br />

Netscape Navigator:<br />

Internet Explorer:<br />

<br />

Browser Version<br />

3.0x Only (any brand):<br />

3 or Later (any brand): <br />

Navigator 4.7: <br />

Navigator 6+: <br />

MSIE 4+: <br />

MSIE 5.5:<br />

<br />

OS Platform<br />

Windows: <br />

Windows 95/98/2000/NT: <br />

Macintosh: <br />

Mac PowerPC: <br />

Unix: <br />

<br />

Element Referencing Style<br />

Use document.all: <br />

Use document.getElementById(): <br />

<br />

<br />

<br />

Sometimes you may need to use more than one of these functions together. For<br />

example, if you want to create a special situation for the window.open() bug that<br />

afflicts UNIX and Macintosh versions of Navigator 2, then you have to put your<br />

Boolean operator logic powers to work to construct a fuller examination of the<br />

browser:<br />

function isWindowBuggy() {<br />

return (isGeneration2() && (isMac() || isUnix()))<br />

}<br />

You can see many more examples of browser sniffing, including more details<br />

about handling AOL browsers, in an article by Eric Krock at: http://developer.<br />

netscape.com:80/docs/examples/javascript/browser_type.html.<br />

401<br />

navigator.appCodeName

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

Saved successfully!

Ooh no, something went wrong!