Web Analytics Made Easy -
StatCounter :: ok browser detect? :: - CodingForum

Announcement

Collapse
No announcement yet.

:: ok browser detect? ::

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    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") {

    ...
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

    Comment


    • #3
      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

      Comment

      Working...
      X