<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> 读取服务端文本文件程序 </title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="Generator" content="EditPlus"> <meta name="Author" content="fason,阿信"> <meta name="Keywords" content="fason,阿信"> <meta name="Description" content=""> <style type="text/css"> <!-- body,div { font:9pt Arial;padding:5px;} --> </style> <script language="JavaScript"> <!-- //** power by fason var src = 'test.txt'; function getFile(){ oDownload.startDownload(src,onDownloadDone); } function onDownloadDone(s) { s = s.replace(/&/g,'&').replace(/\"/g,'"').replace(/</g,'<').replace(/>/g,'>').replace(/\x0d\x0a/g,'<br>'); demo.innerHTML = s; setTimeout(getFile,1000);//1秒钟读一次 }//--> </script> </head><body onload="getFile()"> <IE:Download ID="oDownload" STYLE="behavior:url(#default#download)" /> <div id="demo"></div> </body> </html>
不用js 实现 <HTML XMLNS:t="urn:schemas-microsoft-com:time"> <HEAD> <STYLE> .time{ behavior: url(#default#time2);} </STYLE> <?IMPORT namespace="t" implementation="#default#time2"> </HEAD> <BODY BGCOLOR="white"> <SPAN CLASS=time STYLE="COLOR:Red;" BEGIN="0" END="10" TIMEACTION="visibility"> <H3>Paragraph 1</H3> <P>This is paragraph number one. It is displayed as soon as the page is loaded.</P> </SPAN> <SPAN CLASS=time STYLE="COLOR:Blue;" BEGIN="3" END="20" TIMEACTION="visibility"> <H3>Paragraph 2</H3> <P>This is paragraph number two. It is displayed three seconds after the page is loaded.</P> </SPAN> <SPAN CLASS=time STYLE="COLOR:Green;" BEGIN="6" END="10" TIMEACTION="visibility"> <H3>Paragraph 3</H3> <P>This is paragraph number three. It is displayed six seconds after the page is loaded.</P> </SPAN> </BODY> </HTML>
var n = 0; var src = 'test.txt'; function getFile(){ oDownload.startDownload(src,onDownloadDone); } function onDownloadDone(s) { s = s.replace(/&/g,'&').replace(/\"/g,'"').replace(/</g,'<').replace(/>/g,'>').split("\r\n"); if(n>s.length-1) n = 0; demo.innerHTML = s[n++]; setTimeout(getFile,1000); }
<html>
<head>
<title> 读取服务端文本文件程序 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="EditPlus">
<meta name="Author" content="fason,阿信">
<meta name="Keywords" content="fason,阿信">
<meta name="Description" content="">
<style type="text/css">
<!--
body,div { font:9pt Arial;padding:5px;}
-->
</style>
<script language="JavaScript">
<!--
//** power by fason
var src = 'test.txt';
function getFile(){
oDownload.startDownload(src,onDownloadDone);
}
function onDownloadDone(s) {
s = s.replace(/&/g,'&').replace(/\"/g,'"').replace(/</g,'<').replace(/>/g,'>').replace(/\x0d\x0a/g,'<br>');
demo.innerHTML = s;
setTimeout(getFile,1000);//1秒钟读一次
}//-->
</script>
</head><body onload="getFile()">
<IE:Download ID="oDownload" STYLE="behavior:url(#default#download)" />
<div id="demo"></div>
</body>
</html>
<HTML XMLNS:t="urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>
.time{ behavior: url(#default#time2);}
</STYLE>
<?IMPORT namespace="t" implementation="#default#time2">
</HEAD>
<BODY BGCOLOR="white">
<SPAN CLASS=time STYLE="COLOR:Red;" BEGIN="0" END="10"
TIMEACTION="visibility">
<H3>Paragraph 1</H3>
<P>This is paragraph number one. It is displayed as soon as
the page is loaded.</P>
</SPAN>
<SPAN CLASS=time STYLE="COLOR:Blue;" BEGIN="3" END="20"
TIMEACTION="visibility">
<H3>Paragraph 2</H3>
<P>This is paragraph number two. It is displayed three seconds
after the page is loaded.</P>
</SPAN>
<SPAN CLASS=time STYLE="COLOR:Green;" BEGIN="6" END="10"
TIMEACTION="visibility">
<H3>Paragraph 3</H3>
<P>This is paragraph number three. It is displayed six seconds
after the page is loaded.</P>
</SPAN>
</BODY>
</HTML>
var i=0;
function aa(){
if(i<100){
ShowPlan.innerHTML = ShowPlan.innerHTML+ "<br>" + (i+1);
i++
}
}
setInterval("aa()",1000)
</script>
<body onClick="aa()">
<div id="ShowPlan" style="background-color: #abcdef; font-size: 12px; color: red; width: 600px; border: 1px solid #0099CC;"></div><br>
</body>
<pre>
白日依山尽,
黄河入海流,
欲穷千里目,
更上一层楼。
</pre>
</marquee >
白日依山尽,
黄河入海流,
欲穷千里目,
更上一层楼。
</TEXTAREA>
<INPUT type="button" value="Button"
onclick='ppp.innerText=ttt.value;'>
<marquee direction=up>
<pre id=ppp>
</pre>
</marquee >
var src = 'test.txt';
function getFile(){
oDownload.startDownload(src,onDownloadDone);
}
function onDownloadDone(s) {
s = s.replace(/&/g,'&').replace(/\"/g,'"').replace(/</g,'<').replace(/>/g,'>').split("\r\n");
if(n>s.length-1) n = 0;
demo.innerHTML = s[n++];
setTimeout(getFile,1000);
}
有好多显示方法^
有的是打字机效果等等^