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 8415761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:32:26+00:00 2026-06-10T01:32:26+00:00

I have a script that runs great in IE 9+ and all other browsers.

  • 0

I have a script that runs great in IE 9+ and all other browsers. But in IE 8 or below there are visual errors. I can fix this visual errors by changing some animation effects for IE 8 and below. To do this I need to have two scripts on my page. One for IE 9+, Firefox, Chrome, Safari, and the other for IE 8 and below.

Here is what I have tried:

// First the Script that runs for non-IE browsers. 
<!--[if !IE]>
<script type="text/javascript">
// Script that runs
</script>
<![endif]-->

// Now for the Script for IE 8
<!--[if lt IE 9]>
<script type="text/javascript">
// Script that runs
</script>
<![endif]-->

First Question and the main one is when attempting this it doesn’t seem to work. IE starts acting crazy and the script doesn’t function proerply at all. If I remove the first script and leave the second one it works without issue. It would seem that the <!--[if !IE]><!--> is not working correctly.

Second Question: Using <!--[if !IE]><!--> can I target only IE 8 and below?

  • 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-06-10T01:32:28+00:00Added an answer on June 10, 2026 at 1:32 am

    Try doing it the HTML5 Boilerplate way. Then just target IE versions by class in JS and CSS.

    Replace your opening <html> tag with the following. Adjust to your needs:

    <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
    <!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
    <!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
    

    In JavaScript:

    var isIE8 = document.getElementsByClassName('lt-ie9').length;
    var isIE7 = document.getElementsByClassName('lt-ie8').length;
    
    if (isIE8) {
      ...
    }
    
    if (isIE7) {
      ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following script that is working great, but I want to wrap
I have a script that runs every two minutes for a Tweet-getter application. In
I have a script that runs every minute at XX:00. The script loops over
I have a script that runs at evening, it writes to a log file
I have a python script that runs a program, which generates few .exe files
I have a JScript script that runs using cscript.exe . It creates a shortcut
I have a python script that runs on a cron job. The script uses
I have a php script that runs a mysql query, then loops the result,
I have the following script that runs when a user clicks a link that
I currently have a python script that runs every few minutes and picks up

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.