Re: Netscape help required - correct message

by "Kehvan M. Zydhek" <kehvan(at)zydhek.net>

 Date:  Sun, 23 Jul 2000 05:41:20 -0700
 To:  "Henry Boleszny" <seaeagle(at)one.net.au>,
<hwg-techniques(at)hwg.org>
 References:  pavilion8630
  todo: View Thread, Original
Hi Henry,

Now your message makes sense! :-)

Here's what I did recently for a site that I built that has two versions of
the code. The first version, written in HTML-4 and using extensive CSS-2
code, works about as I expect it to in MSIE 4.x, MSIE 5.x, AOL 4, AOL 5,
Opera 4.x, and Netscape 6/Mozilla. The second version of the site is written
to produce nearly the same effect using NO JavaScript and only HTML-3.2.
This version works for Netscape 3.x, Netscape 4.x, WebTV, and Opera 3.x.

Now, that summarizes the results of the browsers I have on my system, most
installed with default settings. What about browsers I don't have, or if the
visitor has JavaScript turned off? Simple: the detection algorythm detects
this and sends browsers to the appropriate structure anyway.

Here's the detector... This is placed in the first page visited, such as a
welcome page. Once they click off this page, they're in the appropriate
structure (/html3/ or /html4/):

<.script language="JavaScript" type="text/javascript">
    <!--
        var agt=navigator.userAgent.toLowerCase();
        var htmldir = 'html3'
        if ((document.getElementById) || (document.all) &&
(agt.indexOf("webtv") == -1)) {htmldir='html4';}
    //-->
<./script>

The above script is placed in the head of the document. You'll notice WebTV
is singled out -- that's because it claims to be able to use CSS, but really
can't do it properly.

What this does is determine which browsers go where. If the browser can
interpret either the Document.GetElementByID DOM (Net6/Moz, OPR4x, IE5x,
AOL5), or if it can interpret the Document.All (IE4/5, AOL4/5), then it's
assigned to go to the HTML4 directory. Since Netscape 4 uses a different
DOM, it fails this test and gets sent to the HTML3 directory.

Now, later in the body of the page:

<.script>
    <!--
        document.write('<a href="' + htmldir +
'/home.asp"><b>ENTER</b></a>')
    //-->
<./script>
<.noscript>
    <.a href="html3/home.asp"><b>ENTER</b></a>
<./noscript>

This segment writes the <a href> tag in the scripted portion. The htmldir
variable being either html3 or html4. This send people to the proper
structure. Now for the kicker: if they have MSIE5 (or any other browser, for
that matter) with JavaScript turned off, they go to the
HTML3 structure, since the pages in that area were specifically written
WITHOUT JavaScript. Therefore, with a small amount of code, all browsers,
including future browsers and ones that I don't know about, are taken care
of properly.

Hope this helps!
Kehvan M. Zydhek

PS: Remove the . from the tags -- added JUST IN CASE! :-)


----- Original Message -----
From: "Henry Boleszny" <seaeagle(at)one.net.au>
To: <hwg-techniques(at)hwg.org>
Sent: Saturday, July 22, 2000 20:21
Subject: Netscape help required - correct message


> Hi there, experts and lurkers
>
> Please excuse the repeat sending of this message.  My Outlook became
corrupt
> when I loaded Communicator and won't send text-based e-mails.  I somehow
> copied only part of the message last time.  Sorry about that :> !
>
>
>
> For the last two years, I have been kidding myself that our business web
> site was something to write home about.  As long as its viewed in IE, it
> isn't too bad.  I just found out what the site looked like in Netscape ...
> Anyone feeling masochistic can wander over to
http://www.seaeagle.aunz.com,
> particularly if they have Netscape.
>
> Some of the feedback I've already received turned out to be far too polite
> :-/ !
>
> My problem is that I use CSS extensively and my external links don't seem
to
> be working.  That's contributing to the "dog's breakfast" that this site
has
> become.  Can anyone suggest the best way to deal with this?
>
> The other problem is that I now need a sniffer program to point surfers to
> the right version (once I finish modifying our site for Netscapists).  The
> only version I had resided on a floppy diskette, long since zip archived
and
> now irrecoverably damaged.  I know nothing about Java - except that there
> are allegedly a lot of people who surf without out it.  There are
> alternative ways of getting Netscape users to their version of the site -
> the most basic being a plain hyperlink.
>
> Is there a site where I can get some info on cross-browser issues and
> designing for Netscape in particular?  I've neglected this for so long in
my
> myopic site work that I have fallen way behind!
>
> Any suggestions, on or off list, are greatly appreciated!
>
> Henry John & Amy Boleszny
>  Partners
>  Sea Eagle Publications
>  ABN 24 604 217 122
>
> E-mail:         seaeagle(at)one.net.au
> Web:           http://www.seaeagle.aunz.com/
> Phone/Fax:  (07) 5529 2661
> Mail/Locale: 1/9 Possum Court, Coombabah QLD 4216, Australia
>
>
>

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