Twttr.events.bind not working/firing


#1

Hi,

I am using Twitter API to post our campaign URL on Twitter. For that i am creating a Twitter button at run time with new campaign URL by this code snippet:

              // create a clone of the twitter share button template
                var clone = $('.twitter-share-button-template').clone()

              // fix up our clone
                clone.removeAttr("style"); // unhide the clone
                clone.attr("data-url", shareUrl);
                clone.attr("data-text", "Checkout this campaign");
                clone.attr("class", "twitter-share-button");

             // copy cloned button into div that we can clear later
                $('#twitter-share-button-div').empty().append(clone);
                $.getScript('https://platform.twitter.com/widgets.js');

Along with this i am also using tracking function to Twitter button to catch post successfully done on Twitter using twttr.events.bind(‘click’, function()) for that my code snippet is:

    <script language="javascript" type="text/javascript">
    twttr.ready(function (twttr) {
            twttr.events.bind('tweet', function (event) {
                alert("Successful");
                $('#loadingProgressBar').show();
                $("#hd_PostLocation").val('twitter');
                $("#btn_Distribution").attr('disabled', '');
                $("#btn_Distribution").click();
            });
        }); 
    </script>

Previously it was working fine. But from last few weeks this twttr.events.bind(‘click’, function()) is not calling. Did Twitter change its scenario or change its calling way?

Please help me it urgent.