Re: Javascript usage in site (for new windows and NS-CSS)

by "apathetic" <tmbkr(at)apatheticgenius.com>

 Date:  Sat, 29 Dec 2001 10:51:07 -0000
 To:  "Jay Smith" <jay(at)JaySmith.com>
 Cc:  <hwg-techniques(at)hwg.org>
 References:  JaySmith
  todo: View Thread, Original
> In Netscape 4.7x
> (at least), if Javascript is turned off then CSS is also turned off
> because NS uses Javascript to make their CSS handling I guess.

Thats exactly the reason.  A good explanation of why can be found at:
http://css.nu/articles/About-JSSS.html


> When
> that happens, my site goes to pieces.  Any ideas of how to cope with
> this reality -- or just don't worry about it?

I really wouldn't worry about it.  Not many people use Netscape 4, and even
less will have JavaScript turned off.


> How does one 'sniff' for Javascript being on or off (in various
> browsers)?

Pretty simple.  Make your front page up with a message explaining how to
turn JavaScript on, and then use JS to redirect immediately to the proper
front page.  Eg:

    <head>

    <script language="javascript">

    window.location = '/index2.html';

    </script>

    </head>

    <body>

    <p>Blah blah how to turn JavaScript back on blah blah</p>

    </body>

This way, a use with JS turned off will see the message, and a user with it
turned on will be immeditately redirected before they see the message.

HTH,
Tim

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA