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
    Regular Coder
    Join Date
    Jun 2002
    Location
    England =)
    Posts
    518
    Thanks
    25
    Thanked 0 Times in 0 Posts

    :: ok browser detect? ::

    <script language ="JavaScript" type="text/javascript">
    if (document.getElementById)
    {
    document.write('<\script src="files/goodbrowser.js" type="text/javas\cript" language="Java\script"></s\cript>');
    document.close();
    }
    else
    {
    document.write('<\script src="files/lamebrowser.js" type="text/javas\cript" language="Java\script"></s\cript>');
    document.close();
    }
    </script>

    will that work ok? im sick of trying to make stuff look nice in NS4x so will the above use the funky menus for IE5, NS6, moz and IE5+ mac? opera, and use lame menu for old crud like NS4 and IE4 etc.?

    thanks!
    "They hired me for my motivational skills. Everyone at work says they have to work much harder when I`m around" Homer J Simpson

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    seems reasonable - ie4 and ns4 won't get through that test, but all the others you mentioned will. Dunno if you can really count opera in amongst the power browsers .... I like it very much, but for DHTML it sucks badly - might be safer to add it to the crud group, which you can do like this



    if (document.getElementById&&!window.opera) {

    ....


    btw - for strict compliance you would need to go


    if (typeof document.getElementById!="undefined"&&typeof window.opera=="undefined") {

    ...

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    England =)
    Posts
    518
    Thanks
    25
    Thanked 0 Times in 0 Posts
    thanks m8!
    "They hired me for my motivational skills. Everyone at work says they have to work much harder when I`m around" Homer J Simpson


  •  

    Posting Permissions

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