Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Choosing a css file based on filename.


Message #1 by aps@i... on Tue, 18 Sep 2001 08:35:23
You will need to have something to determine which CSS to use, this could 
be a global variable, a cookie or a Query String parameter, then just test 
it. Try something like  :

<script language="javascript">
function StyleSetter()
{
         if (mainsite==1)
         {
                 document.write("<link rel='stylesheet' type='text/css' 
href='style.css'>")
         }
         else
         {
                 document.write("<link rel='stylesheet' type='text/css' 
href='theOtherStyle.css'>")
         }
}
</script>
<script language="javascript">
StyleSetter()
</script>
<body>


At 08:35 18/09/01 +0000, you wrote:

>X-NAV-TimeoutProtection6: X
>Return-Path: <bounce-javascript_howto-628603@p...>
>Received: from mail.p2p.wrox.com (mail.p2p.wrox.com [212.250.238.84])
>         by venus.xoasis.com (8.11.0/8.11.0) with SMTP id f8I92vv06466
>         for <griffiths@x...>; Tue, 18 Sep 2001 02:02:57 -0700
>X-Mailer: P2P web interface



  Return to Index