IE6 links showing blank pages

I recently had a problem with a site I was building where clicking any link in IE6 would just show a blank page. After I hit refresh, it would show the page correctly. It worked in every other browser, and the markup was valid. After googling around, the only answers I could find suggested IE6 was corrupted. I knew this wasn't the case since I tried it on another computer, and every other site worked fine.

Eventually I found the problem. I was doing a PHP include and instantiating an object in the very top of the file, before the doctype and html tag. I moved this into the body, and problem was fixed. These includes were just some libraries and didn't output anything as far as I could tell, so I didn't think it would cause any problems. But lo and behold, IE6 found another way to break.

If you have this problem, try and move any scripting code, even if it's not outputting anything, into the body. Worked for me.