How may I help you?

The journals of a front end web developer

 

Windows Phone, IE9 and Compatibilty-Mode

At work we are implementing responsive design on a self service web app, this one: Telenor Mine Sider (most of the the responsive design part will be out within a month from now). As part of normal development we test in "all" kinds of browsers both automatically with Selenium and manually on different mobile devices and pads. Every developer has as server (jetty) running mostly from IDEA and can develop and test locally with very short deploy cycle times.

One of the devices we test on is the NOKIA Lumia 710, running Windows Phone 7.5 with IE9. We have decided to let IE8 and below get the regular full-size version of the website instead of responsive design (I'll post blog about the how and the why of that later). IE9 in contrast, supports the Media Queries that we use so it gets the full responsive design treat.

However, yesterday when we started using the Lumia to test our system running on a WebLogic server, the responsive design did not kick in as expected. Much head-scratching ensued. A larger than normal consumption of coffee and some cursing (which I personally excel at) was employed without avail. We explored many possibilities. Could the CSS-files be old, or missing all together? Were request-headers being changed because of the https-protocol on the test-server, vs. the http protocol on the development servers? Did the proxy-servers change requests or responses in any way? I had no clue.

Then today Hanne (also a front end developer on our project) suggested that we might look into the same "compatibility mode" issues we experienced a few years back with IE8. In short, IE8 looks at the URL of the site it is displaying and compares that to the local network address of computer/device running IE8. Say you access the URL www.somecompany.com and the network you are on is called local.intranet.somecompany.com. As they partially match IE8 decides that you are visiting an intranet site, and will therefore behave as IE7. The logic behind this is faulty at best IMHO. The internets generally loathed this functionality, and I at least thought that now this was a thing of the past. I was wrong.

A little bit of googling lead me to this page on the MSDN Blogs from March 2008. The answer to our conundrum was this snippet of code : <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
Add it to the HEAD of your HTML-document an it forces all IE-versions to behave at their best and/or newest. It saved the day for us and made IE9 on the Lumia behave as is if it were actually IE9. Wow! How'da thunk it!?

On second thought. Of course IE9 should behave as IE9! I wonder how much more bloated, buggy and hard to maintain IE8 and upwards are because they keep the behaviours of older browsers. And I wonder how long it would take for crappy web apps to be improved if they stopped working in new browsers.
blog comments powered by Disqus
 

Archive