gpt4 book ai didi

javascript - 页面呈现事件/回调上的所有 Twitter 推文

转载 作者:行者123 更新时间:2023-11-30 00:31:51 25 4
gpt4 key购买 nike

我正在使用这个 code .

twttr.ready(function (twttr) {
// At this point the widget.js file had been loaded.
// We can now make use of the twttr events
twttr.events.bind('rendered', function (event) {
// At this point the tweet as been fully loaded
// and rendered and you we can proceed with our Javascript
console.log("Created widget", event.target.id);
});
});

不幸的是,'rendered' 事件将针对每条推文单独触发,是否有适当的方法在页面上呈现/显示页面上的所有嵌入推文时通知

最佳答案

好的,我找到了合适的解决方案。您需要收听 'loaded' event , 仅在显示所有推文小部件后才会触发。

twttr.ready(function (twttr) {
// At this point the widget.js file had been loaded.
// We can now make use of the twttr events
twttr.events.bind('loaded', function (event) {
// At this point all tweets have been fully loaded
// and rendered and you we can proceed with our Javascript
console.log("Created widget", event.target.id);
});
});

关于javascript - 页面呈现事件/回调上的所有 Twitter 推文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29153052/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com