[Javascript] Browser sniffer script question

Lisa Bradshaw zibbler at mediaone.net
Sat Feb 2 11:12:37 CST 2002


Thanks Michael!

That did the trick!


----- Original Message -----
From: "Michael J. Mahony" <igby at mediaone.net>
To: <javascript at LaTech.edu>
Sent: Friday, February 01, 2002 5:42 PM
Subject: Re: [Javascript] Browser sniffer script question


>
> Test for the browser type and then insert the stylesheet information with
a
> document.write command:
>
> function insertStylesheet()
> {
> if(navigator.appName=="Microsoft Internet Explorer")
> {
> document.write "<.link rel='stylesheet' type='text/css'
href='iestyles.css'>"
> }
>
> if(navigator.appName=="Netscape")
> {
> document.write "<.link rel='stylesheet' type='text/css'
href='nsstyles.css'>"
> }
> }
>
> Just call this function where you would want to insert the style sheet:
>
> <html>
> <head>
> <title>Document</title>
> <script language ="javascript">
> insertStylesheet()
> </script>
> </head>
> <body>
> blahblahblah
> </body>
> </html>
>
> Hope that helps.
> Michael J. Mahony
>
> Philippians 4:13 --
>     I can do all things through Him who strengthens me.
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>




More information about the Javascript mailing list