3 months into a project, and now I have to support IE7!

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

Jirin
Posts: 32
Joined: Wed Sep 03, 2008 10:18 pm UTC

3 months into a project, and now I have to support IE7!

Postby Jirin » Mon Mar 19, 2012 5:38 pm UTC

Hello, I'm working on a highly interactive website with a fairly large DOM populated using Backbone. Since this started, a certain coworker of mine insisted that we did not have to support IE7. So, we used a lot of workarounds to make HTML5-like stuff work in IE8 (Albeit with major performance issues). Well, now we do have to support IE7. This is causing not only Backbone to send superfluous get requests to /none for no apparent reason, it is giving me an 'Operation aborted' error that stops half the script from executing.


I have two options: Either reduce the size of the DOM by doing all of the graphical arrangements with JQueryDraw's Canvas/SVG switcher, or figure out how to get IE7/IE8 to run more like IE9/Safari/Chrome/Firefox without making the user download any plugins.

Does anyone have experience making HTML5-like stuff work in IE7/IE8 who can help me?

PS: I am working on a web component that is supposed to look and behave exactly like a native iOS app, and all the designs were done with iOS in mind. I have no control over the fact that I must do things designed for iOS to do in old browsers.

Tynach
Posts: 15
Joined: Fri Dec 02, 2011 6:26 am UTC

Re: 3 months into a project, and now I have to support IE7!

Postby Tynach » Mon Mar 19, 2012 6:13 pm UTC

Well, three things:

  1. I have no actual experience in what it is you're doing, so feel free to ignore me completely.
  2. I always thought that the 'heavier' the DOM, the worse, and the 'lighter' the DOM, the better. Always.
  3. Couldn't you tell your boss/client/whoever that it may not technically be possible?

I'm a sort of 'do it myself entirely' guy - I write my own Javascript, PHP, HTML, and so forth. Whether that means I'm freak'n awesome, or just means I'll be stuck writing fairly simple sites for the rest of my days until I can learn to use other people's libraries, I'll probably not know for a while. As such, I have zero experience with Backbone, JQuery, or others.

However, in my experience of writing by hand, it's always seemed that keeping the DOM as simple as possible has always been the best approach. Each div should mean something significant - if it doesn't, then probably best to get rid of it. CSS3 has greatly helped me achieve that with it's support of multiple backgrounds within one element - no longer do I have to make 4 divs to make a single rectangle with rounded corners, for example.

However, I'm guessing (can't test here) that IE7 doesn't support technologies like CSS3, so you'd make some sort of 'if' statement in the Javascript to say, 'If older version of IE, make 4 divs and give them each a background. Else, one div with CSS3 multiple backgrounds.' It's sorta a pain, but if you just get down to writing each possible condition, it works fairly well - and will only make the DOM as heavy as it needs to be, per browser.


Another issue I just randomly thought of, that I don't know anything about, is that perhaps Backbone is freaking out on IE7 because it just plain doesn't support IE7. But again, that's like some redneck that once fixed his truck by banging it with a stick, making a comment on the chemical structure of the fuel used in racecars.

Jirin
Posts: 32
Joined: Wed Sep 03, 2008 10:18 pm UTC

Re: 3 months into a project, and now I have to support IE7!

Postby Jirin » Mon Mar 19, 2012 7:15 pm UTC

Some of our biggest clients have legacy systems that run on XP, and it was a fight to get them to upgrade to IE7.

I am doing my best to keep the DOM light, but the problem is really that this particular program needs to basically draw a graphical representation of a timeline with a lot of different types of data. I suppose one option would just be to make it from a table into a list of rows in which all the data is absolutely positioned.

A small amount of internet research suggests that Backbone does support IE7, and the issue is that IE7 doesn't like script in child notes affecting the structure of parent nodes. I don't know if there's a way to fix that, since the popular solution, defer: 'defer', does mess with Backbone.

But, I'm also realizing that JQueryDraw is not using SVG for IE8, it is in fact creating lines by creating a div for every rectangle in the line, completely blowing up the size of the DOM.

What would be really awesome is some JS library which makes older IE behave like Webkit.

User avatar
freakish777
Posts: 354
Joined: Wed Jul 13, 2011 2:14 pm UTC

Re: 3 months into a project, and now I have to support IE7!

Postby freakish777 » Mon Mar 19, 2012 8:31 pm UTC

I am doing my best to keep the DOM light, but the problem is really that this particular program needs to basically draw a graphical representation of a timeline with a lot of different types of data. I suppose one option would just be to make it from a table into a list of rows in which all the data is absolutely positioned.


Do you ever allow a user to edit and save their timeline data? If not, do you need Backbone (from their site, that seems like the main reason you'd want it)?

I haven't used Backbone, but having done something similar (several years ago, mind you what I worked on did not get updates from the server to display real time changes, nor did it save any user changes back to the database) for IE7 and whatever the version of FF was at the time, the company I was working for serialized data as JSON, piped it to a hidden field, and then called the appropriate javascript display methods.

While undesirable, you may want to look into having your javascript choose different execution paths for IE7 vs. other browsers (not very maintainable).

Jirin
Posts: 32
Joined: Wed Sep 03, 2008 10:18 pm UTC

Re: 3 months into a project, and now I have to support IE7!

Postby Jirin » Tue Mar 20, 2012 5:31 am UTC

Well, it has to be able to take an arbitrary amount of data. And, this data is not necessarily grouped in chronological order, and columns have to be sorted in varying ways depending on their associations. A ton of processing has to be done on the raw JSON data to build it into a DOM. Also, a ton of animated row expand/collapses must be executed on scroll events.

So, it looks like I have two choices.

1) Convince my boss the benefits of Chrome Frame outweigh the drawbacks of forcing the user to download a plugin.
2) Build the entire DOM on the server side and return it as XML. In which case it will still be impossible to do expand/collapse animations reasonably well in either IE7 or IE8.

User avatar
freakish777
Posts: 354
Joined: Wed Jul 13, 2011 2:14 pm UTC

Re: 3 months into a project, and now I have to support IE7!

Postby freakish777 » Tue Mar 20, 2012 12:52 pm UTC

Option 1 sounds better to me. You don't lose functionality, and you aren't taxing your server with extra work. If it's an internal app that users already have/need, they shouldn't be complaining about a plugin when they refuse to upgrade from IE7.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 12 guests