how do we capture the browser ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • onetwothree
    New Member
    • Sep 2006
    • 1

    how do we capture the browser ??

    [CODE=javascript]var elm = getElmById("myI D");

    function getElmById(aID) {
    var element = null;

    if (isMozilla || isIE5)
    element = document.getEle mentById(aID)
    else if (isNetscape4)
    element = document.layers[aID]
    else if (isIE4)
    element = document.all[aID];

    return element;
    }
    [/CODE]
    here how do we capture the browser, wheather its mozilla or IE
    isMozilla or isIE5 are variables...??
    can you help me in how to check for a particular browser.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Two points:
    1. Don't use browser detection. Use object detection instead - see, for example, this link.
    2. If you must use browser detection, then use the Navigator object which contains information about the client browser.

    Comment

    Working...