I have a similar problem, on this page:
http://emptysquare.net/photography/homeless-shelters/#1/
I use this jQuery code to regenerate the Tweet button each time Ajax
content changes:
var tweet_button = $('#tweet_button_container');
tweet_button.html(
'<a href="http://twitter.com/share" class="twitter-share-button" data-
count="horizontal" data-via="jessejiryudavis" data-url="'
+ document.location.href
+ '" data-counturl="'
+ document.location.href
+ '">Tweet</a><script type="text/javascript" src="http://
platform.twitter.com/widgets.js"></script>'
);
... and that works, but the Tweet-count is always 0 when I reload the
page, no matter how many times I've tweeted the URL.
Tweet buttons with Ajax content seem like a common case, can we get
some guidance about implementing it correctly?
Thanks,
Jesse
On Sep 26, 8:04 pm, Cairo Noleto <caironol...@gmail.com> wrote:
> Hi, I have the same problem. Someone can help us?
> On Mon, Sep 20, 2010 at 08:45, danny <dco...@gmail.com> wrote:
> > I've searched and searched without any luck.
> > I have AJAX content coming in, rendered in HTML with Tweet buttons all
> > over the place.
> > Problem is, the Tweet button does not work (since it appears the
> > Twitter Javascript goes through the loaded page DOM to enable the
> > Tweet button links AFTER the page load).
> > Right now I am manually generating the URL to forward the user to the
> > Twitter message page on a new window.
> > And I don't want to create a Javascript to pop it up in a centered
> > window with a fixed size since I want to stick to what Twitter has
> > already provided in their JS.
> > So anyone figure out how to make the Tweet button work with AJAX
> > content? The only hack I can think of is to unload the Twitter
> > Javascript from the HTML DOM and when AJAX content comes in...reload
> > the Twitter Javascript (I know...it's a very bad hack)
> > Suggestions? Thanks
> > --
> > Twitter developer documentation and resources:http://dev.twitter.com/doc
> > API updates via Twitter:http://twitter.com/twitterapi
> > Issues/Enhancements Tracker:
> >http://code.google.com/p/twitter-api/issues/list
> > Change your membership to this group:
> >http://groups.google.com/group/twitter-development-talk?hl=en
> --
> Atenciosamente,
> Cairo Noleto
> Visitshttp://www.caironoleto.com/