使用AJAX来观看的SQL数据库的变化 [英] Use AJAX to watch SQL database for changes

查看:101
本文介绍了使用AJAX来观看的SQL数据库的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的数据库中的列将被随机更新。当该列被更新,我需要更新我的页面内容。如何使用AJAX + jQuery来仅在数据库的更改执行的操作?

I have a column in my database that will be updated randomly. Whenever that column is updated I need to refresh content on my page. How can I use AJAX + jQuery to perform an action only on DB changes?

推荐答案

使用JavaScript的setInterval函数进行投票,并检查更新的dababase字段的值

use setinterval function of javascript for polling and to check the value of the updated dababase field

检查下面的链接了解更多的细节的http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/

check following link for more detail http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/

这篇关于使用AJAX来观看的SQL数据库的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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