Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 866257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:46:31+00:00 2026-05-15T09:46:31+00:00

I am interested if which would be the best place to detect the client’s

  • 0

I am interested if which would be the best place to detect the client’s user-agent, client-side (javascript) or server-side? I brought up the question due to the fact that some IE8 users are getting a message saying they’re using IE6.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:46:32+00:00Added an answer on May 15, 2026 at 9:46 am

    The short and correct answer is : do not use anything that relies on UserAgent sniffing.

    To reliable be able to adjust code paths you should test for the specific ‘thing’ that the codepath is adjusted for, primarily features. This is called Feature Detection.

    So if feature X is supported we do this, if not we do that.

    Deducing if a feature is supported based on which UserAgent is present will rapidly fail, especially when new browsers come to the marked.
    Take the following example, which can actually be found in several major libraries (!)

    if (isIE8) {
        // use new feature provided by IE8
    } else if (isIE7) {
        // use not so new feature provided by IE7 (and IE8)
    } else {
        // use fallback for all others (which also works in IE7 and IE8)
    }
    

    What do you think happens when IE9 comes along?

    The correct pattern in this case would be

    if ("addEventListener" in foo) {
        // use DOM level 2 addEventListener to attach events
        foo.addEventListener(...
    } else if ("attachEvent" in foo) {
        // use IE's proprietary attachEvent method
        foo.attachEvent(...
    } else {
        // fall back to DOM 0
        foo["on" + eventName] = ....
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would be interested in hearing op opinions from others regarding whether which they
I am interested in knowing what the best software would be to build an
I'm really interested which way you guys use to effectivly debug a large (let's
I'm interested in learning about all ways in which publishing an app on Google
I'm interested in developing software for Sony PlayStation 3 consoles which contains a multi-core
I am interested, which is the optimal way of calculating the number of bits
I'm interested on documentation of the deflate stream format or deflate algorithm which goes
I'm interested in using fcbkcomplete , which has: onselect – fire event on item
I have an Android app which calculates poker odds ( Shufflebot if you're interested).
I'm interested in using an object relational mapper for an existing system which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.