Follow button does not work most of the sometimes

Discussion in 'Twitter' started by AbhijeetMuneshwar, Apr 17, 2014.

  1. #1
    I am using below code in my web app for twitter follow button:

    <a href=https://twitter.com/ABHIJEEEEEEET class="twitter-follow-button"
    data-show-count="true">Follow@directdialogs</a>
    <script type="text/javascript" charset="utf-8">
    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"));
    </script>
    <script>
    twttr.ready(function (twttr) {
    twttr.events.bind('follow', function(e) {
    alert("FOLLOW!")
    });
    });
    </script>
    But alert("FOLLOW!") is not getting triggered in below cases:
    1) Already logged out of twitter & not following @ABHIJEEEEEEET
    2) Already logged out of twitter & following @ABHIJEEEEEEET
    3) Already logged in to twitter & following @ABHIJEEEEEEET

    Please help.
     
    AbhijeetMuneshwar, Apr 17, 2014 IP