On Internet Explorer 8

August 23rd, 2009

Internet Explorer 8 comes with two different rendering engines. “Standards Mode” (they use the term loosely) and “Compatibility Mode”. I’m not going to debate the reasoning behind their choice to ship the browser in this form, smarter people than I have already beaten that horse to death. The problem I have with it is that by default IE ships with a setting that makes anything on your LAN show up in compatibility mode. The button to switch to standards mode isn’t displayed, and worst of all, there is nothing that tells you it is IN compatibility mode.

I recently discovered this when, after carefully testing a site in Internet Explorers 6, 7 and 8, I committed the release to the SVN repo and published it to the staging server. A quick test showed IE8 issues that weren’t there on my local version. Turns out the problem was this default compatibility mode setting. You can turn it off by going to “Tools > Compatibility View Settings” and unchecking the “Display intranet sites in Compatibility View” option. They did this to ensure old intranets are compatible with IE8 out the box, but in the process put every web designer in the awkward position of not knowing their site is broken until they upload.

Internet Explorer 8 isn’t all that bad. It does a pretty good job of fixing the (not so) little things that drove us crazy in previous incarnations, but it’s far from perfect. In the very likely event that you need to code some IE8 specific styles I recommend using conditional comments. In this case I needed one set of modifications for IE6, 7 and compatibility mode 8 (which mostly behaves like IE7) and another for IE8 specifically. To achieve this I used the following code:

<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="css/ie.css" /><![endif]-->
<!--[if IE 8]><link rel="stylesheet" type="text/css" href="css/ie8.css" /><![endif]-->

It uses one stylesheet for everything less than 7 and another for IE8 specifically. Works like a charm, hopefully until IE9 comes along.

IE7 and the JavaScript Prompt

October 27th, 2006

IE7 has shipped and its probably (by and large) a decent browser now. But of course it wouldn’t be Microsoft if they didn’t mess up something. First in what will probably be a long line of security related “features”, Microsoft have decided to modify the way that the good old JavaScript prompt works.

The reason? Phishing sites impersonating or even superimposing themselves on real web sites were using the prompt to lure gullible users into providing credit card numbers, passwords and all sorts of powerful data. So now whenever a web page wants to use a prompt you have to click on the unnoticeable security bar at the top of the browser and “allow” temporary access. To make matters worse the prompt presented is ugly and out of place.

I’m not saying that a prompt is the best way to ask the user for data, but given the whole Web 2.0 movement there are numerous occasions where the prompt is a useful and elegant solution to on-the-fly input. The worst part is that the unscrupulous underbelly of the internet will end up using a modal window or a clever floating div about 15 seconds after they realize their old technique doesn’t work and then who loses? Why, the web 2.0 programmer that thought a JavaScript prompt was a no-brainer in terms of cross-browser support.

Phishing works because people are stupid, making your browser idiot-proof is a surefire way to drive yourself crazy.

Score one for stupidity.