通过 JS 重新渲染推文按钮 [英] Re-render Tweet button via JS

查看:49
本文介绍了通过 JS 重新渲染推文按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经使用这个片段来重新渲染推文按钮.

I used to use this snippet to re-render a Tweet button.

var tweetButton = new twttr.TweetButton(twitterScript);
twttr.render();

但它看起来像 widgets.js (http://platform.twitter.com/widgets.js) 已被修改,因此 twttr.TweetButton 不再是构造函数.

But it looks like widgets.js (http://platform.twitter.com/widgets.js) has been modified so twttr.TweetButton is no longer a constructor.

有人可以帮忙解决这个问题吗?

Can anyone help with this issue?

推荐答案

看起来 twttr.TweetButton 构造函数从未被支持,现在在上次 API 更新后不再起作用:

Looks like the twttr.TweetButton constructor was never supported, and now no longer works after the last API update:

  • http://groups.google.com/group/twitter-development-talk/browse_thread/thread/bcda486acdf4ab42/6a557050f850ccf2?lnk=gst&q=+twttr.TweetButton#6a557050f850ccf2

支持的方法是动态创建一个基于iframe的Tweet按钮:

The supported method is to create an iframe-based Tweet button dynamically:

尽管请注意@Runningskull 的回答以获取更新信息.

Although note @Runningskull’s answer for updated information.

这篇关于通过 JS 重新渲染推文按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆