求网页即时刷新的代码!

来源:百度知道 编辑:UC知道 时间:2024/06/18 02:34:15
譬如那些股票网站啊,网站不刷新,但每只股票会隔几秒刷新一下

用AJAX 里的timer做,里面有个属性刷新时间用毫秒表示 要注意!

请看下面的网页代码
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<meta http-equiv=refresh content="10">
</head>

<body>
</body>
</html>

其中<meta http-equiv=refresh content="10">
是每10秒刷新一次
而且是无限循环的刷新下去
现在可不可以让这个网页只刷新一次就可以了

用AJAX来做

显示股票信息的部分放进一个<iframe>

iframe的页面页头加入<meta http-equiv=refresh content="5">

在页面不刷新的情况下,重新读取已经改变的数据,就得使用ajax