Soldato
- Joined
- 1 Sep 2005
- Posts
- 10,001
- Location
- Scottish Highlands
I've got a piece of code on my website for integrating my twitter feed. It works very nicely, and removes @replies etc. However it doesn't validate as html strict which I would like it to. I think the problem is that there is a DIV within the javascript which isn't allowed, but it needs to be there. Is there any way of getting around this problem? The script takes the twitter content from my twitter account, arranges it as specified in the template line, then outputs it into the tweet div.
Code:
<script type="text/javascript" charset="utf-8">
getTwitters('tweet', {
id: 'Alasdair_Fowler',
count: 3,
enableLinks: true,
ignoreReplies: true,
clearContents: true,
template: '<div id="tweetline"><span class="name"><img height="20" width="20" src="%user_profile_image_url%" alt="user profile" /> <a href="http://twitter.com/%user_screen_name%">%user_name%</a> said: </span> <span class="message">"%text%"</span> <span class="twittertime"><a href="http://twitter.com/%user_screen_name%/statuses/%id%">%time%</a></span></div>'
});
</script>
Code:
<div id="tweet">
<div id="tweetloader">
<img src="/Miscimages/twitterload.gif" alt="twitter loader" />
</div>
</div>