本地文件用fso
外地文件用xmlhttp
如果都不想用
你也可以用一个隐藏的iframe中,将内容不停读到iframe包含的页面中,
刷的时候刷那个iframe

解决方案 »

  1.   

    如果用你说得iframe方法实现,代码怎么写呀,多谢了!
      

  2.   

    <!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,'&amp;').replace(/\"/g,'&quot').replace(/</g,'&lt;').replace(/>/g,'&gt;').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>
      

  3.   

    不用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>
      

  4.   

    <script>
    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>
      

  5.   

    <marquee  direction=up>
     <pre>
     白日依山尽,
     黄河入海流,
     欲穷千里目,
     更上一层楼。 
      </pre>
     </marquee >
      

  6.   

    <TEXTAREA rows=20 cols=20   id=ttt>
     白日依山尽,
     黄河入海流,
     欲穷千里目,
     更上一层楼。
    </TEXTAREA>
    <INPUT type="button" value="Button" 
    onclick='ppp.innerText=ttt.value;'>
     <marquee  direction=up>
     <pre id=ppp> 
      </pre>
     </marquee >
      

  7.   

    var n = 0;
    var src = 'test.txt';
    function getFile(){
    oDownload.startDownload(src,onDownloadDone);
    }
    function onDownloadDone(s) { 
    s = s.replace(/&/g,'&amp;').replace(/\"/g,'&quot').replace(/</g,'&lt;').replace(/>/g,'&gt;').split("\r\n");
    if(n>s.length-1) n = 0; 
    demo.innerHTML = s[n++];
    setTimeout(getFile,1000);
    }
      

  8.   

    也可以搜索一下[html特效]
    有好多显示方法^
    有的是打字机效果等等^