Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Display browser info

    I would like to make an alert come up on a page when it first comes up where it tells the name of the browser that is being used:

    Code:
    <script>
    function BrowserAlert()
    {
    ns4=document.layers;
    ie=document.element;
    if(ns4)
    {
         alert("You are using Netscape 4.");
    {
    else if(ie)
    {
         alert("You are using IE.");
    }
    else
    {
          alert("You are using Netscape 7.");
    }
    }
    </script>
    
    ......
    <html>
    <body onload="return BrowserAlert();">

    Please advise if I am doing this correctly???

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Check this link out for some examples:
    http://www.javascriptkit.com/script/cutindex8.shtml


  •  

    Posting Permissions

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