Twttr.ready for Web Intent async not working with Anywhere!


#1

I’m using intents asynchronously as well as Anywhere on my site. But twttr.ready created in following code while loading platform.twitter.com/widgets.js doesn’t work and I’m unable to add events. May be it’s because window.twttr already exists.

<script src="http://platform.twitter.com/anywhere.js?id=Ie02SeVFcNi4ob4xYdA&v=1" type="text/javascript"></script>
<script>
$(document).ready(function(){
    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('click', clickEvent);
    });
});
<script>

#2

We don’t recommend using both of these technologies together. Best to just use one or the other but not mix them.


#3

But I like Anywhere hovercards and login, while i also want intent events and tweet button( created by platform.twitter.com/widgets.js)


#4

That is totally ridiculous and inflexible. What if I want to use the anywhere library to connect to my twitter application but also use the tweet buttons so I can log events for tracking user tweets.


#5

It’s all a moot point now, @Anywhere is deprecated and will cease functioning on March 5th, 2013 – tomorrow.


#6

#7