irt.org Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt

Q1615 Is it possible to detect the browser and use one of two external style sheets?

You are here: irt.org | FAQ | JavaScript | Misc | Q1615 [ previous next ]

You can do the following:

<html>
<head>
<script language="JavaScript"><!--
if (document.getElementById)
    document.write('<link rel="stylesheet" href="ie5_nn6.css" type="text/css">');
else if (document.layers)
    document.write('<link rel="stylesheet" href="ns4.css" type="text/css">');
else if (document.all)
    document.write('<link rel="stylesheet" href="ie4.css" type="text/css">');
//--></script>
</head>

<body>
...
</body>
</html>

Feedback on 'Q1615 Is it possible to detect the browser and use one of two external style sheets?'

©2013 Martin Webb

ArticlesFAQsGamesFeedback

FOLDOCRFCsInstant JavaScriptSoftwareBooksJavaScript Programmer's ReferenceAboutTop