The IE6 just can't handle :before when you want to insert content into the page via content: in the CSS. Quite annoying if you use it. The IE7 project that I wrote about in the previous article doesn't work reliably for me either - for example, under a Citrix server it won't execute it, probably because some security settings are missing there. Strange. Anyway, I looked at the problem myself and found a fairly compact solution, at least for my specific version of the problem: I just want to place icons before a link.
For this, links have one of three classes or no class: class="zu" defines a collapsed navigation element, class="auf" an expanded one, class="ohne" a link that should not be specially beautified, and all other links get a standard icon.
For this, I simply attach the following code at the bottom of the file just before the /body:
var links = document.getElementsByTagName("a");
for (var i=0; i
I then wrap the whole thing in a conditional comment for IE so that it is only executed by this. That's it. Simple and effective. Disabled JavaScript is not critical in my case, as without JavaScript on the system (it's a business solution with high interactivity) nothing will run anyway in the future - Ajax needs JavaScript as a component ...