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

  • SEARCH
  • Home
  • 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 6695837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:16:13+00:00 2026-05-26T06:16:13+00:00

Source Code: if (navigator.userAgent.toLowerCase().indexOf(‘msie’) != -1 && parseInt($.browser.version, 10)<7) Edited – sorry, posted wrong

  • 0

Source Code:

if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && parseInt($.browser.version, 10)<7)

Edited – sorry, posted wrong code.

What’s the correct formation of the above, to identfiy browsers less than ie9?

thanks

Edit –

Here’s the reason for the code above:

if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) {
                    hidden = document.createElement('<input type="hidden" name="' + atName + '" value="' + attrId + '"/>');
                } else {
                    hidden = document.createElement("input");

it’s for the createElement issue in anything lower than IE9

Additionally, I would love to rewrite the entire function, but due to scope I am unable to rewrite the file until it’s included in a project – so I need to rewrite this one line to work correctly.

  • 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-26T06:16:13+00:00Added an answer on May 26, 2026 at 6:16 am

    AND is not a valid javascript keyword. VERSION neither seems to be declared anywhere. Also I would recommend you to never test against a specific navigator or version but test against whether the browser supports the functionality you want to use. A technique called feature detection. So for example if you want to use the HTML5’s canvas element don’t test if the browser is XXX and the version is YYY. Test if the browser supports the HTML canvas element. Modernizr is an excellent library for this job.


    UPDATE:

    And if you don’t want to hear about good practices and still insist on this browser version detection:

    if ($.browser.msie && parseInt($.browser.version, 10) < 9) {
        alert('Warning, you are running a crap of a browser. Please upgrade!');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My source code needs to support both .NET version 1.1 and 2.0 ... how
source code ... Thing is, if i specify required metadata using fluent modelmetadata provider
Can source code examples be kept in a SQL database while retaining all formatting
Reading source code of sample projects, such as Beast and Bort, are recommended as
I installed the wxWidgets source code, compiled it and am linking the libraries thus
I have some C++ source code with templates maybe like this - doxygen runs
Are there any good source-code analyses tools for OSX. I am particularly interested in
In my C# source code I may have declared integers as: int i =
The following source code alerts the following results: Internet Explorer 7 : 29 Firefox
Everyone uses source-code control to manage versions (right?) and this provides some level of

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.