是否有一个易于嵌入的聊天小部件,允许用户与用户聊天?

发布于 2024-12-05 07:39:38 字数 260 浏览 2 评论 0 原文

我希望向我的网站添加聊天功能,以便我的网站的用户可以互相聊天。我在网上找到的大多数聊天小部件(例如 此处)都允许在站点管理员和用户(出于客户支持的目的)。与客户支持相反,我希望网站上的聊天作为最终功能。我可以使用一个小部件来执行此操作吗?我正在寻找最简单的方法来做到这一点。任何指向正确方向的指针都会有所帮助。

谢谢!

I'm looking to add chat functionality to my site so that users of my site can chat with one another. Most chat widgets I have found online (i.e. such as the ones here) allow for chat between site administrators and users (for the purpose of customer support). As opposed to customer support, I want chat on my site to serve as an end functional feature. Is there a widget I can use to do this? I am looking for the simplest possible way to do this. Any pointers in the right direction would be helpful.

Thanks!

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

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

发布评论

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

评论(1

时光礼记 2024-12-12 07:39:38

如果这是小规模的,您不会有数百个用户,您可能需要从以下解决方案开始:

http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-a-simple-web-based-chat-application/

这里的关键是用户一边是语句:

setInterval(loadLog, 2500);

这是用户在 Javascript 中每 2.5 秒检查一次是否有新内容的地方。将其设置得更高,它不会经常检查,但也不会经常用 PHP 代码对服务器造成错误。该解决方案很容易实现,但也有一个弱点,如果它太流行,您的服务器主机可能会收到太多请求,超出其处理能力。

If this is low scale, where you aren't going to have hundreds of users, you may want to start with this solution:

http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-a-simple-web-based-chat-application/

The key here on the users side is the statement:

setInterval (loadLog, 2500);

This is where the users end in Javascript checks out if there is anything new every 2.5 seconds. Set it higher, and it won't check as often, but it also won't bug the server with the PHP code as often. This solution is easy to implement, but also has the weakness that if it gets too popular, your server host could get too many requests than it can handle.

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