Tweet Intent callback function not firing


#1

Hi All,

I have the following code, and the callback function is not firing. It used to work before, but now its not. I don’t get the “testing” alert after clicking the tweet button. I was wondering if anything was changed on the twitter side…
var myUrl = “www.xyz.com”;
$("#tweetButton").html(’<iframe allowtransparency=“true” frameborder=“0” scrolling=“no”’ +
’ src="http://platform.twitter.com/widgets/tweet_button.html?url=’+myUrl+ ’ "style=“width:130px; height:50px;”>’);

							twttr.events.bind('tweet', function(event) {

alert(“testing”);

				        	}); 
						});

#2

sorry, I think I missed a line in the post above, here’s the revised version:

$(window).load(function () {
var myUrl = “www.xyz.com”;
$("#tweetButton").html(’<iframe allowtransparency=“true” frameborder=“0” scrolling=“no”’ +
’ src="http://platform.twitter.com/widgets/tweet_button.html?url=’+myUrl+ ’ "style=“width:130px; height:50px;”>’);

							twttr.events.bind('tweet', function(event) {

alert(“testing”);

				        	}); 
						});

#3

hmm… I am not sure why this line does not show after saving:
$("#tweetButton").html(’<iframe allowtransparency=“true” frameborder=“0” scrolling=“no”’ +
’ src="http://platform.twitter.com/widgets/tweet_button.html?url=’+myUrl+ ’ "style=“width:130px; height:50px;”>’);


#4

looks like it does not take iframe tags, basically I am using an iframe for the twitter button where I am passing my url


#5

Try wrapping the code snippet in <code> </code> blocks.


#6

ok thanks:

$(window).load(function () { var myUrl = "www.xyz.com"; $("#tweetButton").html('');
							twttr.events.bind('tweet', function(event) {

alert(“testing”);

				        	}); 

						});

#7

Can someone help me out here please? This is happening in all browsers…


#8

#9