Internet Exploder 8

Internet Exploder 8

Grrrrr, why do things have to be so tricky. It’s used by more than 60% of web users so we all have to make sure websites work in it not matter how much of pain the @rse…

Anyway – enough moaning.

Working on www.markbeaumontonline.com and adding Mark’s twitter feed to the frontpage seemed to work fine in Firefox/Chrome etc, but was behaving oddly in IE8 (and other flavours)

The twitter embedded stuff was causing an error as follows

HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)

Caused by the javascript for the twitter call altering the content of the div it resided in. The solution suggested by Microsoft worked and here it is!

<div id=”twitter_defer”>

<!– some other stuff in here –>

<!– this is where it used to just say the following –><!– <script type=”text/javascript” src= ‘http://twitter.com/statuses/user_timeline/cyclingamericas.json?callback=twitterCallback2&amp;count=10’>–>
</div>

<script type=”text/javascript”>

var script= document.createElement(‘script’);

script.type= ‘text/javascript’;

script.src= ‘http://twitter.com/statuses/user_timeline/cyclingamericas.json?callback=twitterCallback2&amp;count=10’;

document.getElementById(‘twitter_defer’).appendChild(script);
</script>