Testing websites in IE6

IE6 Users

We hate it, we want to stop developing for it, but the sad truth is we can not blame all IE6 users for using it as its not always their fault they are still on IE6.

Only last week I was round my mothers and had to put my IT support hat on, like all web developers have to at some point. Looking at her laptop I discovered to my horror her company laptop was on IE6 with JS disabled, until this point I had always thought of these people as distant people that I would never meet, little did I know they were actually as close to me as my own mother!

Testing Testing 1-2-3

So first thing to do is to to get hold of IE6 to test your website on, there are various methods from butchery installs through to emulators. Personally I have always found these go wrong somewhere, or at worse appear to work but the truth is they are not 100% correct in their rendering. The best and only full proof method is to download Microsoft’s Virtual Machine and the latest IE6 XP Service pack 3 image. They release a version every few months that will then provide you a genuine testing platform for IE6.

Its relative

So you install Virtual Machine, get it up and go to your local machine IP (192.168.1.101 or something) and you see a list of directories of sites, in you go and it looks wrong? If there are no images or the CSS file has not been loaded then chances are your links are absolute ( http://localhost/somesite/css/style.css) . The thing is your not on localhost now are you, your on your virtual machine.So localhost means nothing to help your browser find the images or files with it included in the link. To fix this simply take it out, making all your links relative to the index, for example (css/style.css).

WordPress

WordPress loves absolute links, and of course the added issue is the theme directory css file is not really relative to the index file, its in http://localhost/somesite/wp-content/themes/sometheme/css/style.css, so linking to css/style.css or /css/style.css will fail. But the solution is to use a function WordPress gives you called ..

bloginfo('template_directory');

Which will get you http://localhost/somesite/wp-content/themes, but you do not want localhost when connecting from another machine.

What you can do is create another function or edit this one temporarily during testing to return relative links.
In general-template.php you will see a case statement, in here edit the current template_directory case or add your own with a new function added..

case 'template_directory':
		case 'template_url':
			$output = wp_make_link_relative(get_template_directory_uri());
			break;

The result will be a relative link which will then work on your VM for testing!

No excuses now for not testing your site on IE6.