views:

20

answers:

0

Hello,

I want build a twitter ticker in a website. I have this code:

$(document).ready(function(){

 $('#twitter-ticker').fadeIn('slow');

 for(var i=0;i<tweetUsers.length;i++)
 {
  if(i!=0) buildString+='+OR+';
  buildString+='from:'+tweetUsers[i];
 }



 var fileref = document.createElement('script');

 fileref.setAttribute("type","text/javascript");
 fileref.setAttribute("src", "http://search.twitter.com/search.json?q="+buildString+"&amp;callback=TweetTick&amp;rpp=50");

 document.getElementsByTagName("head")[0].appendChild(fileref);

});

That is the first part of the javascript. In that script, javascript show the twitter ticker. But what is now my problem. I want a click event to this javascript.

On the website i have a twitter button. When i click on this twitter button. The twitter ticket must be show. But how can i make a click event to this javascript code? Thanks!