← Back to Upcase

How to handle older versions of Internet Explorer (IE8, IE9)


(David Lee) #1

On my current app, a fair amount of traffic comes from IE8 and IE9 (unfortunately). These browsers in particular have been tricky to deal with since a lot of css and javascript/ajax simply doesn’t work in them. Are there any best practices for handling different browsers which can’t handle things that Firefox and Chrome can?

As one example, I have a form which uses a lot of ajax, but the ajax (and the css) doesn’t work properly in IE8. I’m considering creating a simple html only version of the form to serve up to IE8 visitors. In this case could I just check the user_agent in the controller or view and then based on that show the appropriate version of the form.

Looking forward to hearing everyone’s thoughts. Thanks!


(Scott Hollinshead) #2

@realDLee You could try using Modernizr, this will detect what versions of IE people are using giving them classes like lt-ie9 which you could use to target different versions, and style your form accordingly.

It also detects what CSS3 features cannot be used like flex-box it will add a class called no-flex-box .

All these classes get added to the html tag.

I hope this helps!


(David Lee) #3

Great. I looked into Modernizr and it looks like just what I need. Thanks @scott !