Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

ghaberek

@ghaberek
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How do you name your project?
    G ghaberek

    Pick a foreign language, then translate one or more nouns or adjectives related your product into that language and combine them in some way. Just have fun with it and see what you can come up with!

    -Greg

    The Lounge help question

  • How to have common Sub or Function?
    G ghaberek

    If they are static functions, then create a new Module (Project > Add Module...) and place them in there as Public Shared (Sub|Function).

    -Greg

    Visual Basic tutorial question learning

  • listview alternative
    G ghaberek

    Check out ObjectListView. It takes some time to get used to, but overall it's much more powerful than a standard ListView. http://objectlistview.sourceforge.net/cs/index.html[^]

    -Greg

    Windows Forms csharp algorithms question

  • Browser Support Check
    G ghaberek

    One of our users was sent to a client's site to upload some work files for review. She got a message that said something like:

    This website requires an HTML 4.0 compliant web browser with Javascript enabled. You are using a browser version that does not meet these requirements. It is recommended that you use either Internet Explorer versions 5.5/6.x/7.x, or Netscape version 7.x. Refer to your browser's online help for specific instructions to enable Javascript.

    Yet we are using IE 7 with JavaScript enabled. So I went digging through their page to see what triggered that message and found this little gem:

    function browserSupported()
    {
    var agt=navigator.userAgent.toLowerCase();
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
    && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
    && (agt.indexOf('webtv')==-1));
    var is_nav62up = (is_nav && (is_major >= 5) && (is_minor >=5) && (agt.indexOf("gecko")!=-1) );
    var is_ie = (agt.indexOf("msie") != -1);
    var is_ie3 = (is_ie && (is_major < 4));
    var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
    var is_ie4up = (is_ie && (is_major >= 4));
    var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
    var is_ie55 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5")!=-1) );
    var is_ie55up = (is_ie && ((!is_ie3 && !is_ie4 && !is_ie5) || is_ie55));
    var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.0")!=-1) );
    var is_ie6up = (is_ie && ((!is_ie3 && !is_ie4 && !is_ie5 && !is_ie55) || is_ie6));
    var is_opera = (agt.indexOf("opera") != -1);
    if (is_nav62up || is_ie55up || is_opera || is_ie6up || is_ie6)
    {
    return true;
    }
    return false;
    }

    Note the complete and utter lack of a check for "msie 7.0", let alone the horrible combination of and's and not's to set all those is_<browser> flags. :doh:

    -Greg

    The Weird and The Wonderful javascript ruby html business help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups