Whilst rolling out a new, spruced up, clean site design to my own website that conforms to both XHTML Strict DTDs and CSS 2.1, I encountered a conflict with the javascript scripting involved with the Lightbox that I was implementing. Although the pages continued to validate against the DTDÂ and the CSS was similarly fine, and indeed in Firefox and some instances of IE8 there were no display problems. However in some instance of IE8, having the lightbox running on the page caused some elements of the page to not load correctly, and for the footer to not display at all. Further more I had the KB927917Â error from Microsoft which was as inconprehensible as these things usually are.
By systematically deactivating the various scripts running on the page, I tracked down the problem to the Twitter provided javascript code.
I’ve now put in place a new Twitter feed service, which has the advantage of both working with Lightbox and having an option to abort loading tweets if the site is down (something which was causing a problem during recent twitter outages).
Details
You can see the scripts in action here.
Installation instructions
These are ammended for my install (you can see the original instructions and download the scripts here):
Container HTML
You need to insert a holder element for the twitters to go in to. In the example above, I’ve included some ‘waiting to load’ content – but you don’t have to.
Here’s what I did:
<div id=“tweet”>
 <p>Please wait while my tweets load <img src=“/images/indicator.gif” /></p>
</div>
<p><a href=http://twitter.com/yourtwitterusername>If you can’t wait – check out what I’ve been twittering</a></p>
Here are some more progress indicators.
If you include contents inside the holder div, then you’ll need to set the ‘clearContents’ flag.
Add the script
You should download the twitter.js script, and add the following code within the head or (best at the bottom of the) body tag:
 (this example will generate my twitter status in quotes on a single line with the ‘ago’ linkable back to the original twitter post)
<script src=“http://yourdomain.com/includes/js/twitter.js” type=“text/javascript”></script>
<script src=“http://yourdomain.com/includes/js/twitter.tweet.js” type=“text/javascript” charset=“utf-8″></script>
Create a file called twitter.tweet.js and paste the following code into it:
getTwitters(‘tweet’, {
 id: ‘yourtwitterusername’,
 count: 5,
 enableLinks: true,
 ignoreReplies: true,
 clearContents: true,
 template: ‘%user_name% %text% <a href=”http://twitter.com/%user_screen_name%/statuses/%id%/”>%time%</a>’
});
Note that the getTwitters function will execute after the page has been loaded by your browser. It will fire once the DOM is loaded but before images are loaded.
And your’re done!