I have a simple Javascript that should have the current window reload when the visitor Follows a user in Twitter. When I click the Follow button it greys out and reloads the page, however the user is not actually Followed on Twitter. However when I include an alert(); before location.reload(); it does work and the user is Followed on Twitter. How do I make this work properly without using alert();? This is my current code:
window.twttr = (function (d,s,id) {
var t, js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
js.src="//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
}(document, "script", "twitter-wjs"));
twttr.ready(function (twttr) {
twttr.events.bind('follow', function(e) {
location.reload();
});
});
</script>
<a href="https://twitter.com/itsIniX" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @itsIniX</a>