June 6 2009

Running multiple Internet Explorer versions

When developing websites for our company we always, without execption, go through a stage of complete despair, agony and utter rage. That particular moment occurs when we test our work in the lovely browser made by the ever sympathetic software giant Microsoft. Yes, I’m talking about Internet Explorer, always the first to extract all the fun out of web development.

We test in the three “most recent” versions of Internet Explorer — 6,7 and 8. Calling IE6 a “recent” browser always makes me want to shoot somebody, as the fossil is nearly 8 years old. But there are still some fuckwits who think updating software is stupid, because you shouldn’t change something which isn’t (in their eyes) broken, and happily use the piece of garbage for their daily browsing activities.

The situation with IE 6 had one benefit, there was only one version to consider for support. Now there are three, of which two of them are approaching some level of decency regarding CSS and Javascript support and general HTML rendering.
While I applaud the initiative of some developers to stop developing for IE6, I think testing in at least two versions of Internet Explorer will still be a requirement in the near future. To make matters worse Microsoft made Explorer an integral part of its OS — something Neelie Kroes doesn’t particularly like — so you can’t run standalone versions of their browser without performing some serious voodoo.

I used the <a href=http://tredosoft.com/Multiple_IE”>MultipleIE installer by Tredosoft to accomplish the aforementioned voodoo, but they stopped supporting the application a while ago. There is also a Standalone IE 7 package from the same developer, but that doesn’t work very well in conjunction with MultipleIE 6 install and IE 8.

In the recent comments on the MultipleIE page I came across Internet Explorer Collection, which seems to be a viable alternative to Tredosoft’s package. There are still some rough edges, but overall the experience is as smooth as MultipleIE’s parallel install once was.

UPDATE:
One issue I found was the fact that the scripting error dialog didn’t work, it produces an “Error: 153, Unspecified error” (seriously) on my setup. Not that the scripting error messages spit out by IE are generally very helpful. Microsoft seems to think it’s enough to say on which line the error occurred, without referring to the actual file the offending code is located, it only spits out the URL to the page you’re currently viewing, which isn’t necessarily where your Javascript is located. Anyway, you can circumvent the error by installing DebugBar.

June 6 2009

I ♥ JQuery

Surely the majority of all the people that matter in the world of web development already declared their strong preference for one of the major Javascript frameworks (Prototype.js/script.aculo.us, JQuery, Mootools, Dojo), I just found out I’m love with JQuery.

I’ve used Prototype.js in combination script.aculo.us (still have to Google for the domain name, because I misspell it every time) for all the web projects I’ve undertaken both personally and professionally, because it was the first framework I was introduced to. For our new company’s website I’ve set out to learn more about JQuery, and CakePHP as well, because both seem to offer greater efficiency and architectural cleanness, as opposed to starting a project from scratch.

I love the way how JQuery approaches Javascript. Due to the way it was designed the framework graciously introduces you to the world of unobtrusive Javascripting. With Prototype.js you can achieve the same, but the approach you take is very open, which makes littering your HTML with inline onclick and onmouseover statements very tempting.

The event-driven nature of JQuery is something I had to get my head around at first. Event re-binding when using AJAX becomes a common procedure and it’s something you wouldn’t have to worry about when using the aforementioned inline Javascript. Luckily the excellent JQuery documentation helped me on the way regarding this particular problem.

Basically I had two links with an event attached to it, which — when clicked — would refresh the containing div with new data and the same two links. An AJAX request in JQuery erases all events on such a refresh and they have to be rebound. In code something like this:

1
2
3
4
5
6
7
function backForth() {
  $("a#meta_back, a#meta_forward").click(function(event) {
    var metaId = this.rel.replace("meta-", "");
    $("#meta_content").load("includes/meta.php", {meta:[metaId]});
    event.preventDefault();    
  });
}

Should become more like this:

1
2
3
4
5
6
7
function backForth() {
  $("a#meta_back, a#meta_forward").live("click", function(event) {
    var metaId = this.rel.replace("meta-", "");
    $("#meta_content").load("includes/meta.php", {meta:[metaId]});
    event.preventDefault();    
  });
}

There are other ways to rebind events listed in the FAQ but I found the live function (die clears them) the cleanest way to achieve what I wanted.

Writing unobtrusive Javascript is a breeze!

June 6 2009

Back in the old ecosystem

I’m back on Mac OS X for quite a while now, the whole ATI driver clusterfuck on Linux a few months back drove me over the edge. I had the exact same problem on both machines running fglrx. Suddenly they were unable to load the kernel module and failed to start X. In one case one of my laptops rebooted as soon as X was started.

So back to Apple’s closed ecosystem and I must say I’m enjoying Leopard quite a bit again. Not that Debian and KDE weren’t nice, but the higher level of polish — the little UI things which are hard to describe — in Mac OS X is certainly noticeable when using the OS day by day. Will I go back to Linux someday? I might, but it will take a long while before I make another attempt.
Were my expectations too high? I want a stable OS with a consistent modern-day, 3D accelerated) UI, which allows me to be productive and play games. Both Debian and KDE 4 offer this as separate “packages”, but when it comes together, when those separate packages have to work in unison it ultimately fails. That’s not the fault of Debian nor KDE, but of third-party companies like ATI who fail to deliver a stable basis for open source software.

On a brighter note, Turms is still progressing, although development has been slow the last two months. Large portions of the application already work, but it’s the little details that are the hardest to accomplish most of the time. A plethora of other activities outside the digital realm doesn’t exactly speed up things as well. Turms will still be a cross-platform application written in Qt, but the intended focus on KDE has shifted to Mac OS X. So expect an application which integrates nicely with Mac OS X with secondary support for Linux and Windows.