FBML 元素渲染延迟
我使用 FBML 来渲染页面上的某些元素,例如用户名、个人资料图片等。但是,当页面上有许多 FBML 元素时,在渲染它们之前会出现轻微的延迟 - 这很好,因为 AJAX JS FB 库调用服务器来获取数据。但是,我想隐藏保存这些元素的容器 DIV,直到元素加载完成,那么有没有办法指定 JS 回调函数,当 FBML 数据加载完成时触发该函数?
I am using FBML for rendering certain elements on the page such as the name of the user, profil pic, etc. However when there are many FBML elements on page, there is a slight delay which occurs before they are rendered - that's fine since AJAX calls are made to the server to fetch the data by the JS FB library. However, I want to hide the container DIV holding these element till the elements have finished loading, so is there any way to specify a JS callback function which gets fired when the FBML data has finished loading?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试 FB.Event.subscribe
Try FB.Event.subscribe
还有另一种选择。首先,确保您在所有嵌入上设置了
xfbml=0
参数。接下来,您可以使用这一小段 jQuery:There is another option for this. First, make sure you have the
xfbml=0
parameter set on all embeds. Next, you can use this small bit of jQuery: