gpt4 book ai didi

javascript - 当我在同一浏览器上对另一个选项卡进行任何更改时如何刷新选项卡数据

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

我在浏览器的两个选项卡上打开了我的网站。如果我从一个选项卡的购物车中删除了一件商品。并转到另一个选项卡。我看到商品仍在购物车中。- 当我刷新页面时它工作正常。- 有什么方法可以让我的两个标签同步而不刷新标签。

最佳答案

Is there any way so that My two tab are in sync without refreshing the tabs

是的,使用 Broadcast Channel API ,这允许选项卡之间的通信。

来自发布的链接:

The Broadcast Channel API allows simple communication between browsing contexts (that is windows, tabs, frames, or iframes) with the same origin (usually pages from the same site).

关于javascript - 当我在同一浏览器上对另一个选项卡进行任何更改时如何刷新选项卡数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54359673/

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