高分请教,不够再加:怎样实现数据实时更新? 内嵌一个隐藏的iframe,iframe和父页面通讯,iframe负责根据条件去查询数据库,所得值返回到父页面,用Javascript实现iframe页面的重定向,同时iframe页面重载完毕,将所得结果返回给父页面,实现不更新当前页面,数据及时更新。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如楼上的所说,你可以用脚本,在指定的间隔时间内,reloadiframe即可 不好意思,因为我对JavaScript还不是很熟悉。我想问一下,该如何写?这是Product的内容:<html><title>Product</title><SCRIPT language=Javascript><!--setInterval("refresh()", 5000);function refresh(){ document.productshow.reload("true"); }--><body> //我这样写对么?? <iframe name="productshow" src="product1.html" marginwidth="0" marginheight="0" scrolling="yes" frameborder="1" width="100%" height="50%"> </iframe> //product1.html中是productname和price的信息 </body></html>下面是productshow的内容:<html><body> <frame name="productshow"> <tr><td>productname</td><td>price</td></tr> </frame> //只要更新这些信息 </body></html>谢谢!! http://www.ayinfo.net/kok/codelist.html把这个修改一下就可以了。下载完页面后,刷新时只刷数据,网页保留。 用xmlHTTP,给一个例子,用于实时得到服务器端的时间<html><head></head><body onload="getPage()"><h2>Using the HttpRequest Object</h2><p><b>status:</b><span ID="A1"></span></p><p><b>status text:</b><span ID="A2"></span></p><p><b>response:</b><br><span ID="A3"></span></p></body></html><script type="text/javascript">function getPage(){var objHTTP = new ActiveXObject("Microsoft.XMLHTTP")objHTTP.Open('GET','http://netfish.host.sk/test1.php',false)objHTTP.Send()document.all['A1'].innerText= objHTTP.statusdocument.all['A2'].innerText= objHTTP.statusTextdocument.all['A3'].innerText= objHTTP.responseText}setInterval('getPage()', 100);</script> 网页制作的一个问题 请教各位大侠:js一个让人想死也想不出来的问题 关于js动态加载和图片欲加载的问题 如何取得一个窗口的绝对高度?或者说屏幕高度减去任务栏的高度? 那位大哥有空,请帮小弟解决一个打印问题 关于jquery遍历json的问题 javascript里面的结构如何用到vbscript里? 如何比较两字符串是否相同? 500分请赐教!! to : net_lover(孟子E章)(孟宪会) :有大事求救!!关于bottom帧刷新top帧的问题 关于form 提交请求了两次的问题 关于表单提交时的校验(关于文本框内的数字比较和计算) 经典集--不作描述..之三
你可以用脚本,
在指定的间隔时间内,reload
iframe即可
我想问一下,该如何写?
这是Product的内容:
<html>
<title>Product</title>
<SCRIPT language=Javascript>
<!--
setInterval("refresh()", 5000);
function refresh()
{
document.productshow.reload("true");
}
-->
<body>
//我这样写对么?? <iframe name="productshow" src="product1.html" marginwidth="0" marginheight="0" scrolling="yes" frameborder="1" width="100%" height="50%">
</iframe> //product1.html中是productname和price的信息
</body>
</html>下面是productshow的内容:
<html>
<body>
<frame name="productshow">
<tr><td>productname</td><td>price</td></tr>
</frame> //只要更新这些信息
</body>
</html>
谢谢!!
把这个修改一下就可以了。下载完页面后,刷新时只刷数据,网页保留。
<html>
<head>
</head><body onload="getPage()">
<h2>Using the HttpRequest Object</h2><p>
<b>status:</b>
<span ID="A1"></span>
</p><p>
<b>status text:</b>
<span ID="A2"></span>
</p><p>
<b>response:</b>
<br><span ID="A3"></span>
</p></body>
</html><script type="text/javascript">
function getPage()
{
var objHTTP = new ActiveXObject("Microsoft.XMLHTTP")
objHTTP.Open('GET','http://netfish.host.sk/test1.php',false)
objHTTP.Send()
document.all['A1'].innerText= objHTTP.status
document.all['A2'].innerText= objHTTP.statusText
document.all['A3'].innerText= objHTTP.responseText
}
setInterval('getPage()', 100);
</script>