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 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2006
    Location
    Bahrain
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Check my problem- experts!

    Code:
    <script type="text/javascript" language="javascript">
    if(navigator.appname = Microsoft Internet explorer)
    document.write("Your currently used browser is IE")
    if(navigator.appname = Mozila Firefox)
    document.write("Your currently used browser is FF")
    </script>
    I am using IE 7 but still these are wrong. Help.
    ALWAYS remember to validate your code

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    test for equality with ==, and navigator.appname will give a string, so needs quotes.

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile solution to codingmasta problem

    <script type="text/javascript">
    alert(navigator.appName);
    if(navigator.appName=='Microsoft Internet Explorer')
    alert("you are using Internet Explorer");
    else
    alert("you are using Netscape");
    </script>


  •  

    Posting Permissions

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