2

I'm developing a data visualization page for an intranet using d3.js. The page needs to render in Internet Explorer, which causes trouble since all the intranet pages are rendered in quirks mode. This makes IE throw an error when loading d3: SCRIPT5009: CSSStyleDeclaration is undefined, which then prevents the rest of d3 from loading.

The page works as intended when rendered by by other modern browsers or by IE9 in standards mode, so I believe quirks mode is the problem.

Other limitations, and things I've tried that don't work:

  • The page is served by a templating system (IBM Cognos) I don't have control over. Setting <meta http-equiv="X-UA-Compatible" content="IE=edge"> is therefore not an option, since I can't modify the header.
  • Setting the equivalent tag in the HTTP header is also not possible.
  • If I add a meta tag to the <body>, the only part of the page I have any control over, IE will ignore it.
  • IE's F12 tools claims it's in document quirks mode, although the browser itself is in IE9 compatibility mode. Changing the document mode manually causes the intranet site to reload the page and navigate back to the parent page. I have no idea why.
  • Unchecking "Display intranet sites in Compatibility View" in the compatility view settings does nothing.

At the moment I can think of two ways to solve this: either force IE to render in standards mode, or somehow rewrite d3.js so as to avoid using CSSStyleDeclaration, which causes the crash in the first place. I have no idea how to proceed for either of these.

soapygopher
  • 152
  • 8
  • At this point your best hope might be to get a sledgehammer, walk to the admin's office, and threaten to take their head off with it (or damage their equipment) until they get into this millennium and add a ` ` to their webpages. – Niet the Dark Absol Jun 30 '14 at 09:40
  • @NiettheDarkAbsol I'm only a lowly consultant, so that may be frowned upon. – soapygopher Jun 30 '14 at 10:21
  • Okay, maybe not so literally, but even as a consultant you should be able to explain to them "what you are asking for literally cannot be done unless you fix this". – Niet the Dark Absol Jun 30 '14 at 10:23
  • 1
    I'm looking into it, but since the problem lies with the intranet system it may not be completely under their control. And I can understand if they're reluctant to make sitewide changes, since legacy stuff tends to break. – soapygopher Jun 30 '14 at 10:37
  • But if they had kept up-to-date and not allowed stuff to become legacy stuff, they could have avoided this ;) – Niet the Dark Absol Jun 30 '14 at 10:37
  • Hindsight's 20/20. Doesn't solve my problem :/ – soapygopher Jun 30 '14 at 10:41
  • Like I said, given your current constraints, there is absolutely no way to fix the problem. I would go to a higher-up with three choices: Fix the problem; pay you to spend days, if not months, rewriting d3.js to work with their outdated system; or not have any new work done at all. This kind of relies on the work you're doing being important, but in most cases the first option would be most preferable. – Niet the Dark Absol Jun 30 '14 at 10:42
  • I just had a talk with one of the server guys and he was pessimistic about it. At the moment it looks like the most viable option for us is to redirect the user to a page hosted elsewhere and kind of sidestep the problem altogether. That would give us much more flexibility in terms of page structure etc., but introduces new issues with security, access control and so on. – soapygopher Jun 30 '14 at 11:02
  • Is Cognos rendering the entire web page, or just a portion of it that is being displayed in a frame or such? Have you tried adding the relevant snippet to an HTML item in your Cognos report, or using JavaScript to set it (also in a HTML item) ? – Andrew Jun 30 '14 at 14:55
  • Cognos renders all of it. What I've tried so far: 1) an HTML item in the Cognos report (doesn't work for reasons described above), 2) an ` – soapygopher Jun 30 '14 at 18:22
  • What kinds of visualizations are you attempting, and what version of Cognos are you dealing with? Newer versions ship with their own visualization engine, though this is done a bit differently than d3. – chsh Jul 01 '14 at 11:24
  • Using Cognos Report Studio 10.2. I'm drawing connections between financial securities using the [Sankey diagram](https://github.com/d3/d3-plugins/tree/master/sankey) plugin. There are a large number of many-to-many relationships in the data, and the reason my project was started in the first place was that Cognos's own visualization engine was useless for our purposes. – soapygopher Jul 02 '14 at 08:58

0 Answers0