I’m trying to use a pretty standard twitter search widget, straight from the twitter site:
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'search',
search: '$AAPL',
interval: 6000,
title: 'AAPL',
subject: '',
width: 250,
height: 300,
theme: {
shell: {
background: '#8ec1da',
color: '#ffffff'
},
tweets: {
background: '#ffffff',
color: '#444444',
links: '#1985b5'
}
},
features: {
scrollbar: false,
loop: true,
live: true,
hashtags: true,
timestamp: true,
avatars: true,
toptweets: true,
behavior: 'default'
}
}).render().start();
</script>
And it’s getting loaded like so:
$(".linktosymbol").bind("ajax:success", function(event, data, status, xhr) {
$(".symboldetails").html("");
var target = $("#" + $(this).attr('data-target'));
target.html(data);
});
It never appears though, it seems to just blank the screen and go on loading forever. Ideas?
Had the same issue. The problem is that the Twitter JS creates the markup using
document.write, which only works while the document is being generated. Otherwise it will create a new document.Tip: While debugging, it’s easier to use the original code at
http://twitter.com/javascripts/widgets/widget.js.That is my solution. Add the
idparameter, and Twitter will add the markup to the element with that id (that’s what the topdivis for).Note: I had problems with the minified version of their script, so I used
http://twitter.com/javascripts/widgets/widget.jsinstead.