IE6 death bug

IE6 death bug


Trying to do manipulate an element from within it can cause an error
in IE6. So this WONT work in IE6
<!DOCTYPE html>
<script src="jquery.js"></script>
<div>

foo


<script>
$('div').append('bar');
</script>
</div>
... but will in IE7 and 8. So 7 and 8 look more forgiving, but unlike
other major browsers if you try to manipulate the body before it's
closed, that won't work either. So this won't work in any version of
IE:
<!DOCTYPE html>
<script src="jquery.js"></script>
<body>

foo


<script>
$(document.body).append('bar');
</script>
</body>
I'm inclined to think 'fair enough' - the error message is quite
descriptive ("Unable to modify the parent container before the child
element is closed"), and the fix is quite easy: either move the script
or do it properly with a $(document).ready call.
However (and this is the problem): in either scenario IE6 has a
complete tizz, tells you it's aborting, blanks the page and then
claims you have 'network connectivity problems'.
It's not so much a jquery issue, but a fix might be to check that the
script is not a child of the element that's being modified. It's
probably not worth solving, but I leave it here as reference because
IE6 gives no clue as to why it has gone a bit mad.
AJP