通知系统在PHP / jQuery [英] notification system in PHP/jQuery

查看:128
本文介绍了通知系统在PHP / jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编程某种通知系统。

I want to program some sort of notification system. What would be the be the best way to achieve this?


  1. 通过在页面加载时调用Ajax请求调用数据库?但问题是它只检查页面加载。它会更好,如果它甚至是实时的,我想这取决于消息的优先级。

我使用Cookie PHP和jQuery。

I am using PHP and jquery.

推荐答案

像你说的,这取决于邮件的优先级。

Like you said, it depends on message priority.

如果通知是在访问者执行操作时发出的,则很容易绑定基于会话的通知。

If notifications are made upon the visitor performing an action, it would be easy to tie in session-based notifications.

如果通知是在执行操作的其他用户John对此页面进行了编辑,点击这里查看。),您可以使用长轮询AJAX等待通知。

If notifications are made upon other users performing an action (e.g. "John made an edit to this page. Click here to view."), you could use long-polling AJAX to wait for a notification.

这篇关于通知系统在PHP / jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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