Facebook 聊天窗口是如何实现的?

发布于 2024-07-13 16:11:10 字数 598 浏览 6 评论 0原文

Facebook 上,您可以浏览网站而不影响浮动聊天窗口。 看起来好像主页位于 iFrame 内,而页脚和聊天窗口则浮动在外面。

替代文本
(来源:k-director.com

主要内容是在 iframe 中还是页脚和聊天窗口是在 iframe 中?

后者似乎不可能,因为在这种情况下,当您单击主页中的链接时,所有内容都必须重新加载,包括页脚 iframe。

如果您刷新页面,聊天窗口将重新加载,但如果您通过单击链接浏览网站,则不会重新加载。

谢谢。

On Facebook you can browse the site without affecting the floating chat windows. Seems like if the main page was inside an iFrame and the footer and chat windows where floating outside.

alt text
(source: k-director.com)

Is the main content inside an iframe or are the footer and chat windows the ones inside an iframe?

The later doesn't seem possible because int this case when you click in a link in the main page everything would have to reload, including the footer iframe.

If you refresh the page the chat windows are reloaded, but if you browse the site by clicking links they are not.

Thank you.

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

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

发布评论

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

评论(4

生活了然无味 2024-07-20 16:11:10

如果您安装 FireBug 并启用 Facebook 的网络监视器,您将看到,当您单击应用程序内的大多数链接时,您并不是执行整个页面刷新,而是执行 AJAX 调用,该调用使用新内容更新页面。

它看起来像一个新页面,但实际上您位于同一页面上,除了聊天栏之外几乎所有内容都被替换了。

If you install FireBug and enable the net monitor for Facebook, you'll see that when you click most links inside the application, you're not doing a full page refresh, but rather an AJAX call which updates the page with the new content.

It looks like a new page, but in reality you're on the same page with just about everything but the chat-bar replaced.

萌吟 2024-07-20 16:11:10

可能只是一个绝对定位的 div,包含内容的滚动 div。 Ajax 将提供内容。

Probobly just an absolutely positioned div, containing a scrolling div for the content. Ajax would provide the content.

离笑几人歌 2024-07-20 16:11:10

当您加载新页面时,聊天窗口确实会刷新,但它们会保持其视图状态(打开/关闭/聊天历史记录)。

The chat windows do indeed refresh when you load a new page, they maintain their viewstate however (open/close/chat history).

蓝色星空 2024-07-20 16:11:10

它是一个绝对定位的 div,位于浏览器窗口的底部。 这并不难,我在一个周末从头开始克隆了 ClockingIT 的 Facebook 聊天。

It's an absolutely positioned div, positioned at the bottom of your browser window. It's not hard, I cloned the Facebook chat for ClockingIT from scratch in a weekend.

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