Tweet button only working on refresh


#1

I am building a mobile website that allows users to cycle through images in PHP. The image is also the link to the next page which is simply a $_GET variable in the URL. When I first visit or refresh a page the tweet button loads and works perfectly, but when I click to the next image I only get the regular old link that says “tweet” that opens up a new page with an incomplete tweet. I am just using the code they give you so I am confused as to what this problem could be.


#2

The page is probably dynamically changed. In that case, twttr.widgets.load() needs to be after the content of the page changed, for the button to be displayed properly. You can have more details in https://dev.twitter.com/docs/tfw-javascript#init


#3