I’m trying to implement the Tweet button intent event handler but nothing happens after I test post. A popup window appears for me to tweet. I tweet and it shows that I have tweeted and the window closes. No java “alert” executes afterwards like I want it.
Here’s something similar to what I have:
<div id=“twitter”>Tweet about ASDF on Twitter!</div>
<script type=“text/javascript” src=“http://platform.twitter.com/widgets.js”></script>
<a href=“http://twitter.com/share”
class=“twitter-share-button”
data-url=“https://www.asdf.com”
data-counturl=“https://www.asdf.com”
data-text=“Check out ASDF at https://www.asdf.com”
data-count=“horizontal”>Tweet</a>
<script type=“text/javascript”>
twttr.events.bind(‘tweet’, function(event) {
alert(“tweet occurred”);
});
</script>
Edit: The problem was me running the page “offline”. I needed to execute it on a local server or an online source.