正在寻找 FB.XFBML.parse 回调函数?

发布于 2024-09-08 21:07:57 字数 85 浏览 2 评论 0原文

是否有一个回调函数(例如 onComplete)?我想显示一个装载机。

FB.XFBML.parse()

is there a callback function (e.g. onComplete) for this? I would like to display a loader.

FB.XFBML.parse()

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

赠意 2024-09-15 21:07:58

是的,第二个参数是回调函数。例如这应该有效:

FB.XFBML.parse(document.getElementById('some_element'), function() {
    alert('I rendered');
});

Yes, the second parameter is the callback function. For example this should work:

FB.XFBML.parse(document.getElementById('some_element'), function() {
    alert('I rendered');
});
二智少女猫性小仙女 2024-09-15 21:07:58

同时解析整个页面

FB.XFBML.parse(document, function(){
    alert('I rendered');
});

To parse the whole page by the same time

FB.XFBML.parse(document, function(){
    alert('I rendered');
});
此生挚爱伱 2024-09-15 21:07:58

截至 2013 年,这不起作用。谷歌浏览器将有像按钮一样的“闪烁”,直到它最终为我呈现。该事件在渲染完成之前调用。

为了测试这一点,我尝试隐藏之前有类似按钮的容器(这工作正常)。
然后我测试在 function() { 中显示容器
});
FB.XFBML.parse,此时新加载的按钮看起来正在闪烁。

仅在谷歌浏览器中存在此问题,但它证明它毕竟不像按钮至少在谷歌浏览器中完成了渲染。

As of 2013 this does not work. Google Chrome will have "blinking" like buttons until it is finally rendered for me. This event is called before rendering is done.

To test this I try to hide the container before which has the like buttons (this works fine).
Then I test to show the container in the function() {
});
of the FB.XFBML.parse, that's when it looks like the newly loaded buttons are blinking.

Only having this issue in google chrome, but it proves that it's not after all like buttons have finished rendering in google chrome atleast.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文