Find the answer to your Linux question:
Results 1 to 2 of 2
hi, i would like some assistance with the following script at this link. Dynamic Drive DHTML Scripts- Browser Sniffer Script . i would like to have the script checking the ...
  1. #1
    Linux Newbie
    Join Date
    Dec 2006
    Posts
    119

    Question [SOLVED] Javascript - Web browser checker

    hi,
    i would like some assistance with the following script at this link.Dynamic Drive DHTML Scripts- Browser Sniffer Script. i would like to have the script checking the web browser version on IE5 and IE6 and reject them or giving them a pop-up message saying that they need to upgrade their web browser.

    i have tried everything on the documentation but it doesn't seem to work.

    thanks in advance.

  2. #2
    Linux Newbie
    Join Date
    Dec 2006
    Posts
    119
    never mind.... i was able to fix it with this script that i found that does exacly what i want to do.

    Code:
    <html>
    <head>
    <script type="text/javascript">
    function detectBrowser()
    {
    var browser=navigator.appName;
    var b_version=navigator.appVersion;
    var version=parseFloat(b_version);
    if ((browser=="Netscape"||browser=="Microsoft Internet Explorer") && (version>=4))
      {
      alert("Your browser is good enough!");
      }
    else
      {
      alert("It's time to upgrade your browser!");
      }
    }
    </script>
    </head>
    
    <body onload="detectBrowser()">
    </body>
    
    </html>
    from Tryit Editor v1.4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...