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 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    test for netscape or ie

    I am looking for a way to test for Netscape 6

    if test-for-netscape {
    window.frames['external'].setup(links[aNum]);
    }
    else {
    document.external.setup(links[aNum]);
    }


    These commands will send the values from an array to an iframe, to
    display an image and text. This code works for Netscape

    window.frames['external'].setup(links[aNum]);


    and this code works for IE 6

    document.external.setup(links[aNum]);

  • #2
    New Coder
    Join Date
    Jan 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I found a cheap way to do it, but would rather use something better.


    function showImg(aNum)
    {
    if (navigator.appName.substring(0, 7) != "Microso"){
    window.frames['external'].setup(links[aNum]);}
    else {
    document.external.setup(links[aNum]);
    }
    };

  • #3
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts


    var IE = document.all?true:false
    if(!IE){}
    if(IE){}

    it works for the most cases but if you want something better go check this out ---> http://www.brothercake.com/scripts/sniffer.php

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Object detection is better.
    Code:
    if (window.frames['external'] && window.frames['external'].setup) {
       window.frames['external'].setup(links[aNum]);
    }
    else if (document.external && document.external.setup) {
       document.external.setup(links[aNum]);
    }
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    New Coder
    Join Date
    Jan 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you glenngv, it worked great.


  •  

    Posting Permissions

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