Redirecting Browsers

  • Thread starter For Example: John Smith
  • Start date
F

For Example: John Smith

Hi,

I thought this was simple to do but I have not had any luck. I would
like to have two versions of my web site which are optimised for
different browsers. One version for IE and one version for Netscape /
Mozilla. How do I redirect visitors to different pages based on their
browser?

For instance they come to the site and access index.html. If they are
using IE, index.html continues to load. If they are using Netscape or
Mozilla, they are automatically redirected to index-ns.html.

What is the trick to making this work?

Thank you!

Reply only to group please!
 
L

Lasse Reichstein Nielsen

For Example: John Smith said:
I thought this was simple to do but I have not had any luck. I would
like to have two versions of my web site which are optimised for
different browsers. One version for IE and one version for Netscape /
Mozilla. How do I redirect visitors to different pages based on their
browser?

As an Opera user, I recommend against being that specific.
For instance they come to the site and access index.html. If they are
using IE, index.html continues to load. If they are using Netscape or
Mozilla, they are automatically redirected to index-ns.html.

Should Netscape 4 be redirected too? It has no more similarity with
Netscape 6+ than IE does.

<script type="text/javascript">
if (navigator.appName == "Netscape") {
location.href = "index-ns.html";
}
</script>

If you don't want to include Netscape 4, you can add the condition
parseInt(navigator.appVersion,10)>4
Reply only to group please!

Ofcourse. But you should still have a valid reply address, mr.
For Example.

/L
 
F

For Example: John Smith

Interesting, thanks for the info. But why then do I always hear talk of
browser re-direction? It seems like a popular and widely used "trick"
 
F

For Example: John Smith

I'm not familiar with Opera? I thought most people used IE now (like 97%
according to the last survey I read). Anyways, I just wanted to do the
people using Netscape a favor, see my other post. Thank you for the code
sample I will recompile to suit my needs.
 
L

Lasse Reichstein Nielsen

For Example: John Smith said:
The problem is with JAVA. I use three freeware JAVA APPLES to do
things on my page. Like I use one to draw the background and one to
do a banner ad and one to play the background sound. IE displays
JAVA flawlessly through the Windows Virtual Machine but Netscape
crashes a lot of times because it uses the Sun Virtual Machine.

I use IE with the Sun JVM, so detecting browsers isn't sufficient.
It sounds like the fault is with Sun's JVM, but it is Microsoft's
JVM that is badly broken according to the Java standard (created
by ... Sun :).

Also, you don't want to detect Netscape then, but detect anything
non-Windows-IE, in case you can't detect JVM build.
So I want people using Netscape (which Mozilla is derived from)

It's the other way around. Netscape 6+ is based on the browser
developed by the Mozilla Project (which was supported by Netscape
Corp (now bought by AOL et al)).

/L
 
C

Charles Banas

I'm not familiar with Opera? I thought most people used IE now (like 97%
according to the last survey I read). Anyways, I just wanted to do the
people using Netscape a favor, see my other post. Thank you for the code
sample I will recompile to suit my needs.
that's an old survey. :)

I use Opera myself, even on my work machine (because it is also my
preferred mail client). a more recent survey might now i'm in about a 10%
bracket of users. :)

keep also in mind that more and more people are installing linux these
days, which means they probably use one of these browsers:
Mozilla
Opera
Konqueror
Lynx
Mosaic

though i really don't know how many people actually use Mosaic. Lynx is
much better IMHO. :)

http://www.opera.com - Opera
http://www.kde.org - Konqueror
 
C

Charles Banas

Interesting, thanks for the info. But why then do I always hear talk of
browser re-direction? It seems like a popular and widely used "trick" on
the Internet.
not any more. i haven't seen a single page use redirection in almost 2
years. i've seen sites moving more and more toward single-page solutions.
for example, the Junkyard ( http://the-junkyard.net/ ) puts all of its
content in a MySQL database. so, having a redirect only introduces more
headaches.

it's easier to make all those changes in stylesheets. at tJY, we have
several stylesheets for our site that users can choose to get the browsing
experience they want.

(you might also notice the "Mac" styles. those limit the width of the page
and nothing more. it's because one of the staffers complained about it
breaking on his mac.)

the last time i saw redirection was actually when i was playing with a
WYSIWYG website editor. i don't recall the name of it, but the company was
ultimately bought by Macromedia and their technology was used in
DreamWeaver. whatever the case, it used a LOT of IE-only and NS-only
tricks to simulate layers because neither really supported it. it was
quite a mess and ended up requiring a redirect. it wasn't even very
reliable, as i recall.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top