Twitter follow button iframe integration and callbacks



We’ve had an issue using the iframe based integration of the twitter follow button and having callbacks working. When the iframe option is used, the callbacks specified doesn’t seem to work. Here’s a simple example that shows this -

We’ve tried the anchor based approach and with that the callbacks seem to be working ok -

Can some one confirm if the callbacks don’t work/not supported with the iframe option?

– Imran


Sorry, callbacks are not supported in the IFRAME implementation.


Thanks for your response. Do you think it’d be useful having a note in the documentation in the IFRAME integration section about this (possibly for others who might have the same question)?


Thank you for the question this has been bothering me for some time.


If you use the iframe implementation but change the href from /share to /intent/tweet, the twitter button renders as the iframe but then you can use‘tweet’, function(event) {
//Do Something!

to bind events as per the intents approach documented:


If you pass additional param to src, you will be able to listen for events. But i think it’s more like a hack

#_=1384154225969 - is a valid timestamp


Can you post the event this calls back to? is it similar to this?

window.twttr = (function (d,s,id) { var t, js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js=d.createElement(s);; js.src="//"; fjs.parentNode.insertBefore(js, fjs); return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } }); }(document, "script", "twitter-wjs"));

window.twttr.ready(function (twttr) {'tweet', function (event) {