Consider the following code snippet about Twitter API. data.followers_count didn’t work if placed in anchor tags. There’s some simple concatenation problem I can’t fix because of the many brackets. Any help is greatly appreciated.
function(data){
$('#twitter').html( document.getElementById('twitter').innerHTML + twitterusername[i] + ' ' +
<a href='someURL' title='someTitle'>data.followers_count</a> + ' Followers' + '<br/>');
}
just break them up to simple parts
and presto! no concatenations and no plus signs!
alternatively much shorter solution (i just cleaned code and didn’t notice it was an append operation):