如何使页面自动平滑地刷新 [英] How to make page refresh automaticaly and smoothly

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

问题描述

如何使页面自动,顺畅地刷新...就像Facebook一样吗? :-\

How to make page refresh automaticaly and smoothly...jst like the way facebook does it?? :-\

推荐答案

AJAX,Javascript,jQuery和良好的思维力是答案
AJAX, Javascript, jQuery and good thinking is the answer


<html>
<head>
<script type="text/JavaScript">
function timedRefresh(timeoutPeriod) {
	setTimeout("location.reload(true);",timeoutPeriod);
}
</script>
</head>
<body onload="JavaScript:timedRefresh(5000);">
</body>
</html>


首先,Facebook进行部分页面更新和异步回发.如果您的网站是一个动态网站,那么它也是您的呼叫中心(即AJAX Control Toolkit和UpdatePanel),否则,使用Java语言,您可以经常刷新页面.对于没有大量数据的页面,我不建议您仅使用AJAX.

不要以为这本身就是一个解决方案,但评论将被忽略...

干杯...
well, first of all, Facebook does partial page updates and async post backs. If your website is a dynamic one then that''s your port of call too (i.e. AJAX Control Toolkit and UpdatePanel), otherwise, using a Javascript you can time to refresh the page every so often. For pages with not lots of data all over, i wouldn''t recommend using AJAX only otherwise.

Don''t think this is a solution per se, but a comment would have been overlooked...

Cheers...


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

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