我想定时刷新页面,读取数据库,取出一定的内容后显示在<marquee>标签上,如何实现,马上给分

解决方案 »

  1.   

    下面的函数将一个字符串strXML发送到指定的地址ActionFileURL,该URL返回一个xml
    不知道对你有没有帮助。
    function DataCommunicate(strXML,ActionFileURL)
    {
    var xmlDoc = new ActiveXObject("MSXML.DOMDocument");
    xmlDoc.async = false;
    strXML = "<OilMIS>" + strXML + "</OilMIS>";
    var httpObj = new ActiveXObject("Microsoft.XMLHTTP");

    if(xmlDoc.loadXML(strXML))
    {
    httpObj.Open("POST",ActionFileURL,false);
    httpObj.Send(xmlDoc);

    if(xmlDoc.loadXML(httpObj.responseText)==false)
    {
    return "<OilMIS>FALSE</OilMIS>";
    }
    else
    {
    return "<OilMIS>" + xmlDoc.xml + "</OilMIS>";
    }
    }
    }
      

  2.   

    <meta http-equiv="refresh" content="5">5表示 5 秒
      

  3.   

    在你 页面里只要 查询数据库,把内容放到 MARQUEE 里就可以了<marquee runat="Server" id="m"></marquee>后台
    m.innerText = "this is a test";
      

  4.   

    alexzhang00() 好的,谢谢,那如何实现无闪烁阿,
      

  5.   

    <meta http-equiv="refresh" content="5"> 这种方法肯定是要闪的。你用我前面的方法得到一个字符串,这个你就可以解析你的字符串,然后你就可以设置<marquee runat="Server" id="m"></marquee>的内容了。
      

  6.   

    <meta http-equiv="refresh" content="5"> 这种方法肯定是要闪的。你用我前面的方法得到一个字符串,这个你就可以解析你的字符串,然后你就可以设置<marquee runat="Server" id="m"></marquee>的内容了。你觉得你的方法不会闪???和服务器打交道有可能不闪么?请教
      

  7.   

    呵呵,和服务器打交道当然也可以做到不闪了,就是用Microsoft.XMLHTTP对象来通讯。
    我给你弄个例子,加我QQ:149495143