自动刷新Web页面 [英] Auto refresh web page

查看:117
本文介绍了自动刷新Web页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页,允许用户执行各种操作,进而修改数据库。此外,此Web应用程序需要跟踪数据库中随时间变化的各种字段。每隔几秒刷新页面最好的方法来实现这个?例如,如果在需要滚动的页面上有一个长列表,则由于刷新而使页面保持重置,因此很难查看该列表。我知道,有办法保留滚动的位置。

I have a web page which allows the user to carry out various operations that in turn modify the database. Also, this web application needs to keep track of various fields in database that keep changing with time. Is refreshing the page every few seconds the best possible way to implement this? For example, if there is a long list on the page requiring scrolling, it is hard to view the list since the page keeps resetting due to the refresh. I know, there are ways to retain the position of the scroll. But, could I use something more efficient?

推荐答案

使用AJAX与timer.Using这样我们可以刷新页面中的特定部分。

Use AJAX with timer.Using this we can refresh the particular part in the page.

这篇关于自动刷新Web页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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