jQuery - 通知库 - 轮询
是否已经有为 jQuery 编写的通知库?一种提供下拉消息的方式,类似于 StackOverflow 的方式。
正在寻找这样的东西:
1)每几秒轮询一次(也许可以选择彗星)
2) 有一个标记为已读的调用(注意到 StackOverflow 通过 POST 请求执行此操作)
Is there a notification library written for jQuery already? One that would provide dropdown messages similar to the way StackOverflow does it.
Looking for something that:
1) Polls every couple of seconds (maybe option to do Comet)
2) Has a mark-as-read call (noticed StackOverflow does this via a POST request)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
为什么需要图书馆?
客户端
服务器端
标记为已读的
按钮:服务器端
客户端
Why would you need library??
client-side
server-side
button to mark as read:
server-side
client-side
看看 Socket.IO。它在服务器端使用 Node-js,但您可以使用 javascript-client socket.io .js 独立。
它会选择浏览器中可用的最佳传输,并为您提供基于事件系统的漂亮 API。
wiki 中还提供了不同编程语言的服务器实现列表。
Have a look at Socket.IO. It uses Node-js on the server side, but you may use the javascript-client socket.io.js independently.
It chooses the best transport available in the browser and gives you a nice api based on an event-system.
There is also a list of server implementations in different programming languages in the wiki.
自从提出这个问题以来已经有一段时间了,但为了将来的参考,请查看 Pines Notify http://pinesframework.org/pnotify/ 。
如果您使用的是 .NET,请在 http://signalr.net/ 上查看 SignalR。
Pines Notify 为您提供基于 JavaScript 的弹出通知。您可以使用 jQueryUI 或 BootStrap 为弹出窗口设置主题,并可以提供阻塞或非阻塞通知。
SignalR 处理通信方面。它非常灵活并且使用起来非常简单。它允许您从 .NET 调用 javascript 方法,以及从 javascript 调用 .NET 方法。
将它们放在一起,您只需很少的工作就可以获得一个非常好的通知包。
It's been awhile since this was asked, but for future reference, check out Pines Notify at http://pinesframework.org/pnotify/.
If you're using .NET, then check out SignalR as well at http://signalr.net/.
Pines Notify gives you javascript-based pop-up notifications. You can theme the popups using either jQueryUI or BootStrap, and can provide either blocking or non-blocking notifications.
SignalR handles the communications side. It's extremely flexible and very simple to use. It allows you to call javascript methods from .NET, and .NET methods from javascript.
Put them together, and you've got a very nice notification package with very little work.
据我所知没有。无论如何,一半的工作需要在服务器端完成。我在 http://www.strategynerd.com/sngames
它展示了一个基本的轮询方法。由于它使用实时通信,因此轮询速度很快,但您越不活跃,轮询开始的速度就越慢。不过,彗星和长轮询显然比这种方法要好得多。
Not that I know of. Half of the work will need to be done on the server side anyways. I made a MUD in with JQuery/Asp.NETC# here at http://www.strategynerd.com/sngames
It shows a basic polling method. Since it uses live communication it polls quickly, but the less active you are the slower the polling starts to go. Comet and long polling are obviously much better than this method though.