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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:19:48+00:00 2026-05-27T22:19:48+00:00

Sorry, this is almost certainly a duplicate, but I’ve been searching StackOverflow and haven’t

  • 0

Sorry, this is almost certainly a duplicate, but I’ve been searching StackOverflow and haven’t been able to find the answer. Hopefully if I phrase it in the most general terms I can, it will help someone else in the future.

I’m including some scripts in my web page which work awesomely in Chrome/FF/Opera/Safari/IE9, but are not compatible with IE8 or below (for info, it’s the awesome D3.js).

How can I use make sure that the page fails gracefully in IE<9?

Ideally I would prefer for IE<9 users

  • not to download D3.js external scripts at all and
  • to show them a ‘Sorry, this won’t work for you’ message in my page script, rather than attempting to use the D3 libraries and causing a JavaScript error.

Current code in the HTML page:

<script type="text/javascript" src="/js/d3.js"></script>
<script type="text/javascript" src="/js/mylocal.js"></script>

And in the JavaScript file, from the opening line:

var vis = d3.select("#vis")
.append("svg:svg")
.attr("width", w)
.attr("height", h)
.append("svg:g");
// etc

How should I change these to make sure that only browsers that support D3 will download and try to execute it?

  • 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-27T22:19:49+00:00Added an answer on May 27, 2026 at 10:19 pm

    You should use IE conditional comments:

    <!--[if lt IE 9]>
    <p>Sorry, this won't work for you</p>
    <![endif]-->
    
    <!--[if gt IE 8]><!-->
    <script type="text/javascript" src="/js/d3.js"></script>
    <script type="text/javascript" src="/js/mylocal.js"></script>
    <!--<![endif]-->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this has been discussed somewhere else on stackoverflow (I could not find
Sorry if this is a little off-topic for regular stackoverflow questions, but we're tearing
Sorry if this is a really basic question but it's been really getting to
I'm sorry if it's a duplicate of some question but this is specific on
Sorry if already asked, but I can't find anything on this. I am moving
Sorry if this has been answered already, but I think I actually lack the
First off, I am sorry if this is a duplicate, but every time I
Sorry to be posting this question. :( But I have spent almost the entire
Sorry I can't find a question answering this, I'm almost certain someone else has
Sorry - my question is almost identical to this one but since it didn't

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.