最好的方式来显示通知和消息住在一个网页上? [英] Best way to show notifications and messages LIVE on a webpage?

查看:139
本文介绍了最好的方式来显示通知和消息住在一个网页上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣做即时通讯一样的meebo与Facebook和MySpace都具有一个非常好的方式,也为网页上的通知。例如在现在我的网站,当用户收到新邮件,照片评论,轮廓意见,朋友的要求,一些其他的事情,他们将获得他们在使用jQuery和AJAX页面上的通知消息和纽带。我beleive大规模,这是不是这样做,虽然我的jQuery的code将不得不basicly运行PHP脚本来查询MySQL表每隔30秒左右的谁的网页打开每个用户的最佳方式与此脚本运行。我想最终在某种即时通讯工具添加像Facebook已经在屏幕底部的聊天栏,如果我能找到这样做的有效方式。我所听到的术语彗星和HTML5 WebSockets的,但我不知道,如果这些都是我应该看这样一个功能的解决方案?我想保持带宽至少和运行queary每隔几秒钟,似乎不是很有效的一个高流量的网站。

I am interested in a really good way of doing instant messaging like meebo and facebook and myspace all have, also for notifications on a page. Example on my site now, when a user receives a new mail message, photo comment, profile comment, friend request, some other things, they will receive a notification message and link on the page they are on using jQuery and AJAX. I beleive on a large scale that this is not the best way to do it though as my jquery code will have to basicly run a PHP script to query the mysql table every 30 seconds or so for every user who has the page open with this script running. I would like to eventually add in some sort of instant messaging like facebook has in a chat bar at the bottom of the screen if I can find out an efficient way of doing it. I have heard the terms Comet and HTML5 WebSockets but I am not sure if these are the solutions I should be looking at for such a feature? I would like to keep bandwidth at a minimum and running a queary every few seconds does not seem very efficient on a high traffic site.

如果你知道一些好的解决方案,请解释一下它们是如何工作的一点点,请

If you know some good solutions, please explain how they work a little bit please

推荐答案

我认为Facebook使用 XMPP 了解他们的聊天记录,所以看看吧。

I think Facebook uses XMPP for their chat, so have a look at it.

XMPP是

一个开放的技术进行实时交流,这权力了广泛的应用,包括即时通讯,presence,多方聊天,语音和视频通话,协作,轻巧的中间件,内容聚合,以及通用路由XML数据。

an open technology for real-time communication, which powers a wide range of applications including instant messaging, presence, multi-party chat, voice and video calls, collaboration, lightweight middleware, content syndication, and generalized routing of XML data.

您想安装一个单独的服务器来处理邮件,并在您的应用程序,你会实现与可用的中的一个的客户机。

You'd install a separate server to handle messaging and in your app you'd implement a client with one of the available libraries.

这篇关于最好的方式来显示通知和消息住在一个网页上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆