开发者

real time notifications with jquery and php

开发者 https://www.devze.com 2023-02-03 11:32 出处:网络
I\'m trying to find some php and jquery tutorial/plugin or piece of code which enables to get the real time notifications. For example, if some data is inserted in the database, i want to receive the

I'm trying to find some php and jquery tutorial/plugin or piece of code which enables to get the real time notifications. For example, if some data is inserted in the database, i want to receive the notification on the webpage in real time without refresh etc. If you开发者_如何学Python know any resource, please let me know. Bundle of thanks.


You will need to poll the server, preferably using long polling (not trivial with PHP).

The server can respond blank, or a JSON message if there is something to be returned.


here is periodic updater built as a jQuery plugin that tries to implement long polling and reduce the load on the server.

https://github.com/RobertFischer/JQuery-PeriodicalUpdater/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号