<html>
<head>
<title>Untitled Document</title>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<meta http-equiv='pragma' content='no-cache'>
</head>
<script language="VBScript">
dim id
sub window_onload()
setInterval "DownXml",1000
end subsub DownXml()
dim xmlobj,NumRnd
randomize
NumRnd=100000*rnd+1
set xmlobj=createobject("Microsoft.XMLHTTP")
xmlobj.open "GET","myxml.asp?view=1",false
xmlobj.send
top.mainFrame.document.write(xmlobj.status&"-")
top.mainFrame.document.write(xmlobj.statusText)
set xmldom=xmlobj.responseXml
set objnode=xmldom.documentElement.childNodes
top.mainframe.document.write("<table>")
for i=0 to objnode.length-1
top.mainFrame.document.write("<tr><td>"&objnode.item(i).nodename&"</td>")
top.mainFrame.document.write("<td>"&objnode.item(i).text&"</td></tr>")
if objnode.item(i).nodename="id" then
id=objnode.item(i).text
end if
next
top.mainFrame.document.write("</table>")
set xmlobj=nothing
set xmldom=nothing
set objnode=nothing
end sub
</script>
<body>
myxml.asp文件中必需是输出XML格式文档,如:
也可以使用setInterval结合xml无刷新通知,下面是一段示例代码。myxml.asp文件中检查部门经理是否有新的文件。
<iframe name="mainFrame" src="about:blank"></iframe>
</body>
</html>
<%
response.ContentType="text/xml"
response.Expires=0
response.Write("<?xml version=""1.0"" encoding=""gb2312""?>")&vbcrlf
response.write("<msg><file><filename>新文件</filename></file></msg>")
%>
<head>
<title>Untitled Document</title>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<meta http-equiv='pragma' content='no-cache'>
</head>
<script language="VBScript">
dim id
sub window_onload()
setInterval "DownXml",1000
end subsub DownXml()
dim xmlobj,NumRnd
randomize
NumRnd=100000*rnd+1
set xmlobj=createobject("Microsoft.XMLHTTP")
xmlobj.open "GET","myxml.asp?view=1",false
xmlobj.send
top.mainFrame.document.write(xmlobj.status&"-")
top.mainFrame.document.write(xmlobj.statusText)
set xmldom=xmlobj.responseXml
set objnode=xmldom.documentElement.childNodes
top.mainframe.document.write("<table>")
for i=0 to objnode.length-1
top.mainFrame.document.write("<tr><td>"&objnode.item(i).nodename&"</td>")
top.mainFrame.document.write("<td>"&objnode.item(i).text&"</td></tr>")
if objnode.item(i).nodename="id" then
id=objnode.item(i).text
end if
next
top.mainFrame.document.write("</table>")
set xmlobj=nothing
set xmldom=nothing
set objnode=nothing
end sub
</script>
<body>
myxml.asp文件中必需是输出XML格式文档,如:
也可以使用setInterval结合xml无刷新通知,下面是一段示例代码。myxml.asp文件中检查部门经理是否有新的文件。
<iframe name="mainFrame" src="about:blank"></iframe>
</body>
</html>
<%
response.ContentType="text/xml"
response.Expires=0
response.Write("<?xml version=""1.0"" encoding=""gb2312""?>")&vbcrlf
response.write("<msg><file><filename>新文件</filename></file></msg>")
%>
解决方案 »
- js scroll 滚动连续多次触发事件怎么只执行一次
- 一个关于ext tabpanel的问题,特急,谢谢!
- 关于jquery和ajax的问题
- jsp相关问题
- 谁有在IE里视频播放代码
- arguments?
- 请问*****如何获得光标在文本框的位置??急!急!
- focus and select and chaneg the backgroud color
- 誰有關於JavaScript操縱Table的相關資料--收到給分
- 江湖救急!急!急!急!急!
- 谁能介绍一下getElementById的详细用法吗?
- ----------发贴就百分--------------弹出窗口,窗口大小自适应图片大小???
<script>
function get()
{
window.status='欢迎您的光临';
document.getElementById('img').src='1.jpg?temp='+Math.random().toString();
}
window.onload=function()
{
window.setInterval('get()',5000);
}
</script>
<body>
<img src="1.jpg" id="img">
</body>