Creating tweet button dynamically via JavaScript


We have a cms to allow our users to dynamically add multiple elements to a page with a tweet button. In order for the user to add these elements, they click a button that opens a new window to allow them to specify the tweet text included with each button. When they hit save, we inject into the parent page the new tweet button element and when we do this though, just the Tweet link is shown instead the tweet button image.

What is the function called in this file that we can call to have the code loop through our page to find the appropriate elements tagged with twitter-share-button and tweetbutton class to render out the tweet button (full image).

Thanks, Brad


I believe you’re looking for this function: twttr.render(); which you can execute once your page is completed loading.


In different areas of discussion/documentation it states to use twttr.widgets.load() to re-evaluate dynamically loaded content…how are they different, or the same?


Update: this function will rescan the page and re-render the added widgets.


please give the code of tweet button here




please give me the code for my tweet button here!


twitter, u are the best !


I want a twitter button guys. How do I create it?