Re: Opera Problems - anyone else

by "Andy Innes" <innax(at)>

 Date:  Thu, 28 Mar 2002 15:32:30 +0200
 To:  "Peter-Paul Koch" <gassinaumasis(at)>,
 References:  hotmail
  todo: View Thread, Original
Well, I read through this - and it doesn't really seem like a valid

"If you want to know whether the browser that views your page supports
certain objects you want to use in your code, you should never EVER use a
browser detect. Sure, you know that this-and-that browser will support your
code while such-and-so browser won't. But how about other browsers, obscure

While browser detection works well enough for 90% of your visitors, some
obscure browsers won't be treated correctly and browsers that appear after
you've written the page may not be adequately covered either. The results
would be either a stream of error messages or a script that isn't called
while the browser can easily handle it. In both cases, you're cheating your
end users and coding incorrectly."

Basically - my detect script determines that ANYTHING which is not ie 4 or
later gets redirected to the static page. Unfortunately, Opera 6 is ID'ing
itself as IE 4 or higher by default (on installation).

Here it is:

//<script language="JavaScript">
URL) { //v3.0
  var newURL='', verStr=navigator.appVersion, app=navigator.appName, version
= parseFloat(verStr);
  if (app.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
  } else if (app.indexOf('Microsoft') != -1) {
    if (version >= IEvers || verStr.indexOf(IEvers) != -1)
     {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
  } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
  if (newURL) { window.location=unescape(newURL);
document.MM_returnValue=false; }

<body bgcolor="#FFFFFF"
urn document.MM_returnValue">


----- Original Message -----
From: "Peter-Paul Koch" <gassinaumasis(at)>
To: <innax(at)>; <hwg-techniques(at)>
Sent: Thursday, March 28, 2002 4:07 PM
Subject: Re: Opera Problems - anyone else

> >My default page does a browser detect and sends msie 4 or later to the
> >with flash and all others to the one without (which displays correctly in
> >NN
> >4.78 and Opera
> >
> >The problem here is that OPERA IDENTIFIES ITSELF AS IE5.0 BY DEFAULT!
> >
> >So - the script runs on Opera - detects ie5.0 - and sends Opera to the
> >wrong
> >page, Opera reads the embed tag and creates a 3-4px gap around the Flash
> >file, thus breaking the table.
> >
> >Can anyone think of a way around this?
> Then the script has been written in the wrong way. First of all it is
> possible to detect Opera even when it tries to disguise itself, secondly
> using a browser detect for determining which code branch should run, is a
> bad idea.
> Browser detect without problems:
> Why not to use it:
> ppk
> _________________________________________________________________
> Chat with friends online, try MSN Messenger:

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