问题
I have some issue with twitter intent share functionality, the "tweet" event triggered on click the share button itself(before opening the popup). I have checked the "click" and "tweet" events and both events are triggered simultaneously.
twttr.ready(function (twttr) {
twttr.events.bind(
'click',
twitter_share_callback);
twttr.events.bind(
'tweet',
twitter_share_callback);
});
function twitter_share_callback(response) {
console.log(response)
$("#response").append(response.type+"<br>")
//code
}
The working example JsFiddle
I Wish to get the "tweet" callback right after successfull tweet.
Thanks in advance for your valuable time.
回答1:
Finally i was able to find the reason behind the issue
From November 20th twitter will be making a change to the tweet, follow, retweet and favorite JavaScript events when using Twitter for Websites. They will now be triggered when a user invokes the action in your page, rather than after the action is completed.
For more info https://twittercommunity.com/t/forthcoming-change-to-web-intent-events/54718
来源:https://stackoverflow.com/questions/33950630/twitter-intents-tweet-event-callback-triggering-on-click-instead-of-tweet