Hi to all,
hope you all will be fine, I use a script to detect IE and Mozilla but the problem is when i run it in the firefox it won't work then i find out the name of navigator and it shows Netscape. How i detect Mozilla here is my scrip, it works fine but how i detect mozilla thanks. If i check that _app=='Mozilla' it shows unsupported browser. Thank you. One thing more is it required to enclose my script in <!-- -->.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title>
</head>
<body>
<script language="Javascript" type="text/javascript">
document.writeln(navigator.appName);
   if(!navigator.javaEnabled()){
      alert('Enable your java to expeirience this java enhanced page or\n try install it...');
      location.replace('http://java.sun.com');
      window.open('instructionsforintallingjava.html');
   }
   else{
      var _app = navigator.appName;
      
      if (_app == 'Netscape') {
         document.write('<embed code="CapturePlayback1.class"',
                        'width="200"',
                        'height="200"',
                        'archive="CapturePlayback1.jar"',
                        'mayscript="true"',
                        'pluginspage="http://java.sun.com/products/plugin/index.html#download"',
                        'type="application/x-java-applet;version=1.6">');
                        
      }
      else if (_app == 'Microsoft Internet Explorer') {
         document.write('<OBJECT ',
                        'classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"',
                        'codebase="http://java.sun.com/update/1.6.0/jinstall-6u13-windows-i586.cab#Version=1,5,0,0"',
                        'width="200"',
                        'height="200">',
                        '<PARAM name="code" value="CapturePlayback1.class">',
                        '<PARAM name="archive" value="CapturePlayback1.jar">',
                        '<PARAM name="name" value="BrightAmericans">',
                        '<PARAM name="mayscript" value="true">',
                        '</OBJECT>');
       }
       else {
          document.write('<p>Sorry, unsupported browser.</p>');
       }

   }
</script>

<noscript>

Enabled javascript please

</noscript>

</body>
</html>

I could be wrong but i dont think there is one, as far as I know, when u use

navigator.appName

, the result in Mozilla will be Netscape.

So if the code checks for Netscape it would work in Firefox

Hi :) ,
Hope you will be fine. Oooooops :ooh: thanks yup i think you are right, because after changing to netscape it works on Mozilla firefox :P
Thank you :icon_lol:

Pleasure

Don't forget to mark the thread as solved.

Hi,
How i mark my thread solved :?:
Thank you

Sorry for asking its so simple just click on Mark as Solved :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.