LinuxSA Mailing list archives
Index:
[thread]
[date]
[subject]
[author]
[stats]
From: Andrew Lord <andrewlord@internode.on.net>
To : <linuxsa@linuxsa.org.au>
Date: Tue, 29 Apr 2003 01:23:13 +0930
Re: navigator.appName
Hi Mark,
Thanks for your response.
On Tue, 29 Apr 2003 12:12 am, you wrote:
> On Mon, Apr 28, 2003 at 11:59:32PM +0930, Andrew Lord wrote:
> > Just wondering if anybody has an idea as to why, in the browser Galeon,
> > when I run a page that contains JavaScript with the line "
> > document.write (navigator.appName);" the browser is reported as being
> > "Netscape" ?
>
> Because various incompatible dialects of JavaScript need to know what
> kind of browser you are using so that they know which bugs to insert
> or write-around.
>
> Netscape is the one that Galeon is bug-compatible with.
>
> > Further
> > to the point, how do I get the true name of the browser, such as
> > "Galeon" or "Mozilla" into my JavaScript ?
>
> If you really need to know, you're not writing good JavaScript. Whatever
> you do should be browser-independent.
>
No, you're right. I'm crap at writing JS. So I'm using some stuff I got off
the web. Unfortunately, it's a fairly complicated little collection of JS
and it's beyond my current skill level to identify why it works with some
browsers, and not with others.
The core of the problem is that the script works with Netscape 7 and above,
and with that horrible thing IE 5 and above, as well as with Mozilla 1.3 and
Galeon 1.3x too (hoorah! hoorah!) but not with IE4 or Netscape 4. I can
write a script that says, say, if Netscape appName is IE or Netscape &
appVersion is 4, then do xxxxxxx, otherwise do yyyyyyy. No problems. But
with Galeon and Mozilla reporting themselves as Netscape through appName,
when they evolve to version 4 then anyone using those browsers will find
themselves on the (inferior) Netscape/IE 4 page. Obviously that's going to
be a while away so I'm probably worrying about nothing . . . by the time
Galeon & Mozilla get up to versions 4, my JavaScript skills will have evolved
to navigate the problem! ;-)
Cheers,
Andrew Lord
> > I'm guessing that it must be possible, since
> > I have seen web site hit stats that report hits from the Galeon browser.
>
> They'll be using the web server referrer logs; nothing to do with
> JavaScript.
>
> - mark
>
> --------------------------------------------------------------------
> I tried an internal modem, newton@atdot.dotat.org
> but it hurt when I walked. Mark Newton
> ----- Voice: +61-4-1620-2223 ------------- Fax: +61-8-82231777 -----
--
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.freenode.net
To unsubscribe from the LinuxSA list:
mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject
Index:
[thread]
[date]
[subject]
[author]
[stats]
Return to the LinuxSA Mailing List Information Page