I've experienced a very weird crash on Windows Internet Explorer (XP SP2, English) just yesterday. So here's the problem and the solution and may be, just may be it will help somebody.. someday.
The problem is that IE was crashing on me completely. And according to reports I was getting, mshtml.dll was the problem - so it is definitely IE's HTML renderer (thanks Remedee for pointing this out as I suck as Windows debugging - 100% Mac user).
And the code I was having on the page was just an ordinary blocked output (photo + description, in a SPAN tag), just as follows:
<span class="item">
<a xhref="girls.html?id=<?=$stuff[id]?>" onclick="girlinfo(<?=$stuff[id]?>); return false">
<?php article_printImageTag($stuff[id], 120, 120, "top_1", 1) ?>
</a>
<?php echo $stuff[title] ?>
</span>
The result was a grid of pictures with descriptions under them.
The problem was that if I had over 23 such blocks on a page, IE was just crashing on me!! With some weird "illegal access" 0xC0000005 in mshtml.dll (or something) error. And of course ALL OTHER browsers (Firefox, Safari, Opera) were processing the page without any noticable problems at all.
Well I dunno.. was thinking about inline javascript was causing the problems. And inline javascript is NOT a good thing, but of course it depends.. for example if you have LOADs of images and want to create something like lightbox gallery that would work without needing to wait for the whole page to load (and it WILL take time for lots of images). Anyways.. I was using inline Javascript and though it was causing the problem, so got rid of it, but it didn't help at all. Then.. I just started to remove blocks of code and the problem seem to disappear, but I was left with a non-functional page (I need it to look exactly the way I want, and anyway, that's not a huge amount of markup to be able to play with many combinations).
In the end, the solution for the problem was to add the <span> tag around the text below the picture. JUST TWO TAGS solved the problem.
The resulting code was just like the one below:
<span class="item">
<a xhref="girls.html?id=<?=$stuff[id]?>" onclick="girlinfo(<?=$stuff[id]?>); return false">
<?php article_printImageTag($stuff[id], 120, 120, "top_1", 1) ?>
</a>
<span>
<?php echo $stuff[title] ?>
</span>
</span>
Now.. I don't know what was the source of the problem for IE. It could be that I just suck at coding and and don't know the basics. And I definitely will remember about the problem and solution in the future.. But can anyone explain my.. WHY?.. Well it was rhethoric question I guess :)
PS: Oh and yes, the page actually validates..