<META HTTP-EQUIV="REFRESH" CONTENT="x; URL=*.*">  
x ---- 刷新间隔 单位:秒
*.* ----地址

解决方案 »

  1.   

    楼上正解,
    不过这样会屏幕会不断的闪,
    有一种方式就是用frame. 分左右两个frameset.左面隐藏不断刷新,右面显示 当左面变化刷新显示。
      

  2.   

    呵呵,谢谢Building(建筑物)!可以了,马上结贴
      

  3.   

    对呀,屏幕会闪,那blue999star能不能给个例子,我着急要,以前有没有用过。多谢了!
      

  4.   

    楼主,我只能给你提供一个思路,我写完给你,那你干什么去呀~~~~~
    我手上没有现成的,我也的现写,还不如你自己写,对吧。
    HOHO~~~~
      

  5.   

    我也是这么想的,但是确实存在这个闪烁的问题,不知道blue999star能不能说说你的这种方法是怎么消除闪烁问题的!谢了
      

  6.   

    呵呵~~~~~ Building(建筑物)
    to jianlin(妞妞)
    由左边的隐藏页面不断刷新来扑捉变化。有变化刷新右面的页面显示。无变化,则不刷新右面得页面。给用户看的只是右面的页面。
      

  7.   

    我支持blue999star(星星要挣钱,养老婆) 的技术和做法
      

  8.   

    如果想真正的实现无刷新现实变化的页面,有一种好的方法就是采用socket。
    也就现在应用很广的server push技术。就是无刷新聊天室。
    我用过我说的那种方法,原理就是巧妙的用了frame.
      

  9.   

    to blue999star
      我知道了,就是说在不是特别频繁的变化的情况下,如果采用frame的这种方式就不用每次都刷新,而只是在数据变化的情况下刷新,而不用这种方式,就每次都会去刷新一次页面,所以就会经常闪烁,我这样理解对吗?多谢指导
      

  10.   

    response.setHeader("Refresh","1");
    每隔一秒刷新一次,绝不会闪烁
      

  11.   

    感谢老天呀,楼主理解的完全正确。
    realby(忽然睡了)
    状态栏里是闪的吧不闪 状态栏是主页面的,你不断刷新的是frame的frameset.
    index.htm
    left.htm
    right.htm
    看到的是index.htm的状态栏,不断刷left.htm,left变 right变。
    我们看到的内容是right的内容. 
      

  12.   

    哦,谢谢blue999star了,我以前没做过网页。不过我知道大概怎么处理了。frameset好像是javascript的东东吧,我去看看先!!
      

  13.   

    To  blue999star(星星要挣钱,养老婆) :
    在下对server push技术颇感兴趣,不过只是听过一两遍而已,想问阁下有这方面的资料吗?
      

  14.   

    blue999star(星星要挣钱,养老婆) :
      

  15.   

    to blue999star  哦,是这样,了解了~~有空试一下~谢谢~!我以前试过页面里隐藏的Iframe的情况~是闪的~
      

  16.   

    能详细说说“应用很广的server push技术”吗?当server的访问量比较大时用刷新server可能无法承受的
      

  17.   

    不刷新的:<span id=palySan >
    </span><iframe src="tmp.jsp" id=tmpFrame>
    </iframe>tmp.jsp
    ------
    <html>
    <META HTTP-EQUIV="REFRESH" CONTENT="x; URL=tmp.jsp">  <!--用一下哈哈--!>
    <%
    ....
    String objValue="你要显示的";
    %>
    </html>
    <script language=JavaScript>
    parent.document.all.palySan.innerHTML="<%=objValue%>"
    </script>------
      

  18.   

    <iframe src="tmp.jsp" id=tmpFrame style="display:none">
    </iframe>
    更正一下,这样就看不见刷新桢了,你可以看CPU显示的和不显示的CPU相差很大。
      

  19.   

    再to blue999star 
      再问一个简单的问题,要怎么能使frame隐藏呢?谢了
      

  20.   

    to:ManFirst 你这样做~~状态栏里是按照CONTENT=x 秒闪的~
      

  21.   

    ManFirst的方法也挺好的,只是不知道是什么原理。能解释一下吗?谢了
    哈哈,这么多高手,太感谢了
      

  22.   

    真的不好意思:楼主借宝地一用了。
    to yellowzhong(程序黄了) 
    to mickey_uuu() 
    我的理解很浅薄。我是这样理解的。首先,无刷新的实现是基于socket协议的,用户和服务的socket是不断的,始终处于一种接受状态,形象的就是相当于你访问一个很大的网页,服务器会不断的把信息给你,明显的表现就是你的状态栏一直处于打开网页的状态。
    不知道说什么了~~~~ socket server 是自己的不断监听用户的某一端口。有变化的数据,就把变化传给全部的用户。实现了聊天。 网上有好多这方面的资料。google
      

  23.   

    简单了JAVASCRIT
    SERVER PUSH 我刚才去看了一下,没有意义,你能建立几个SOCKET能,还要每个SOCKET起一个监视进程,唉那服务器牛的。
    我看除非是局域网,除非是视频通信,否则,拖跨你服务器。
      

  24.   

    好东西大家分享呀!
    ManFirst(ManFirst)的方法真好。SERVER PUSH 应该有点点用的。呵呵~~~ 
    ManFirst(ManFirst) 真的是牛人呀 看了一下就知道没意义。多亏我没花时间去研究
    SERVER PUSH 谢谢点拨。
      

  25.   

    但是ManFirst:
      见笑了,我刚才参考你的代码改了一下我的,但是有问题,我现在想问一下你,你的tmp.jsp是------以上的代码,还是以下的代码。我的理解应该是以上的代码,然后以下的是显示用的jsp文件,是吗?小妹刚学,简单的问题希望不要笑话
      

  26.   

    还有blue999star ,我的问题你好没回答呢,谢谢!
     再to blue999star 
      再问一个简单的问题,要怎么能使frame隐藏呢?谢了
      

  27.   

    牛鼻不是吹的,哈哈,2000年我就写1万行JAVASCRIPT
      

  28.   

    给你们一个我写的经典JAVASCRIPT不另收费。
    ------
    <html xmlns:v = "urn:schemas-microsoft-com:vml">
    <head>
    <script language="JavaScript">
    var FromHeight=200;
    var FromWidth=FromHeight;
    var OpenMill=true;   //cut a second to 10
    var ChangeMolde=false;//if change
    var BeginDrag=false;
    var rectHour;
    var rectSecond;
    var rectMinter;
    var ClockTime;//
    var HourfillColor;//object of hour point.
    var MinfillColor;//object of minuter point.
    var DragObject="none";//changed object.
    var OldPointMin=0;//take old Minuters Have point to see back or forward
    var MondifyHour=0;//When changed,the time is.
    nUnit="px";//input the unit.
    function MoldeChanged()
    {
    if (!ChangeMolde)
    {
    var Now = new Date();
    ChangeMolde=true;
    document.ondragstart=new Function ("return false");
    document.onselectstart=new Function ("return false");
        rectHour.onmouseover=OverPoint;
        rectHour.onmouseout=OutPoint;
        rectHour.onmousedown=Function ("DownPoint('rectHour')");
        rectMinter.onmouseover=OverPoint;
        rectMinter.onmouseout=OutPoint;
        rectMinter.onmousedown=Function ("DownPoint('rectMinter')");

    }
    else
    {
    ChangeMolde=false;
    rectHour.onmouseover=new Function ("return false");
        rectHour.onmouseout=new Function ("return false");
        rectHour.onmousedown=new Function ("return false");
        rectMinter.onmouseover=new Function ("return false");
        rectMinter.onmouseout=new Function ("return false");
        rectMinter.onmousedown=new Function ("return false");
    document.onclick=new Function ("return false");
    document.ondragstart=new Function ("return false");
    document.onselectstart=new Function ("return false");
    ClockSpan.onmousemove=new Function ("return false");
    SetTime(0);
    }

    }
    function SetTime(SetEvent)
    {

    var Now = new Date();
                var Seconds = Now.getSeconds();
                var Minutes = Now.getMinutes();
                var Hours = Now.getHours();
                var minSeconds=Now.getUTCMilliseconds();
                ClockTime.value=Hours+":"+Minutes+","+Seconds;
                if (!OpenMill)
    minSeconds=0;
              rectSecond.rotation=Seconds*6+minSeconds*0.006;
    rectMinter.rotation=Minutes*6+Seconds/60;
    if (Hours>=12)
    Hours=Hours-12;
    rectHour.rotation=Hours*30+Minutes/2;
    HourfillColor.angle=Hours*30+Minutes/2;
    MinfillColor.angle=Minutes*6+Seconds/60;

    if (!ChangeMolde)
    {
    window.clearTimeout(ColokInterval);
        var ColokInterval=window.setTimeout("SetTime(0)",100);
     }}function MovePoint()
    {

    var ModifyMinuter;
    if (DragObject!="none")
    {
    if(DragObject=="rectHour")
    {
    if (((window.event.y-0.5*FromHeight)<0) && ((window.event.clientX-0.5*FromHeight)>=0))
    {
    HourfillColor.angle=Math.atan2((window.event.clientX-0.5*FromHeight),(0.5*FromHeight-window.event.y))*(180/Math.PI);
    rectHour.rotation=Math.atan2((window.event.clientX-0.5*FromHeight),(0.5*FromHeight-window.event.y))*(180/Math.PI);
    }
    else if(((window.event.y-0.5*FromHeight)>=0) && ((window.event.clientX-0.5*FromHeight)>0))
    {
    HourfillColor.angle=90+Math.atan2((window.event.y-0.5*FromHeight),(window.event.clientX-0.5*FromHeight))*(180/Math.PI);
    rectHour.rotation=90+Math.atan2((window.event.y-0.5*FromHeight),(window.event.clientX-0.5*FromHeight))*(180/Math.PI);
    }
    else if(((window.event.y-0.5*FromHeight)>0) && ((window.event.clientX-0.5*FromHeight)<=0))
    {
    HourfillColor.angle=180+Math.atan2((0.5*FromHeight-window.event.clientX),(window.event.y-0.5*FromHeight))*(180/Math.PI);
         rectHour.rotation=180+Math.atan2((0.5*FromHeight-window.event.clientX),(window.event.y-0.5*FromHeight))*(180/Math.PI);
    }
    else if(((window.event.y-0.5*FromHeight)<=0) && ((window.event.clientX-0.5*FromHeight)<0))
    {
    HourfillColor.angle=360-Math.atan2((0.5*FromHeight-window.event.clientX),(0.5*FromHeight-window.event.y))*(180/Math.PI);
         rectHour.rotation=360-Math.atan2((0.5*FromHeight-window.event.clientX),(0.5*FromHeight-window.event.y))*(180/Math.PI);

    }
    MondifyMinuter=Math.floor((rectHour.rotation-Math.floor(rectHour.rotation/30)*30)*2);
    OldPointMin=MondifyMinuter;
    }
    else if(DragObject=="rectMinter")
    {
    var NowPointMin=0;
    if (((window.event.y-0.5*FromHeight)<0) && ((window.event.clientX-0.5*FromHeight)>=0))
    {
    if (OldPointMin>45)
    {
    rectHour.rotation=Math.floor(rectHour.rotation/30)*30+30;

    }
    else
    {
    MinfillColor.angle=Math.atan2((window.event.clientX-0.5*FromHeight),(0.5*FromHeight-window.event.y))*(180/Math.PI);
    rectMinter.rotation=Math.atan2((window.event.clientX-0.5*FromHeight),(0.5*FromHeight-window.event.y))*(180/Math.PI);
    NowPointMin=Math.atan2((window.event.clientX-0.5*FromHeight),(0.5*FromHeight-window.event.y))*(180/Math.PI);
    rectHour.rotation=Math.floor(rectHour.rotation/30)*30+NowPointMin/12;
    }
    OldPointMin=NowPointMin/6;

    }
    else if(((window.event.y-0.5*FromHeight)>=0) && ((window.event.clientX-0.5*FromHeight)>0))
    {
    MinfillColor.angle=90+Math.atan2((window.event.y-0.5*FromHeight),(window.event.clientX-0.5*FromHeight))*(180/Math.PI);
    rectMinter.rotation=90+Math.atan2((window.event.y-0.5*FromHeight),(window.event.clientX-0.5*FromHeight))*(180/Math.PI);
    NowPointMin=90+Math.atan2((window.event.y-0.5*FromHeight),(window.event.clientX-0.5*FromHeight))*(180/Math.PI);
    rectHour.rotation=Math.floor(rectHour.rotation/30)*30+NowPointMin/12;
    OldPointMin=NowPointMin/6;

    }
    else if(((window.event.y-0.5*FromHeight)>0) && ((window.event.clientX-0.5*FromHeight)<=0))
    {
    MinfillColor.angle=180+Math.atan2((0.5*FromHeight-window.event.clientX),(window.event.y-0.5*FromHeight))*(180/Math.PI);
        rectMinter.rotation=180+Math.atan2((0.5*FromHeight-window.event.clientX),(window.event.y-0.5*FromHeight))*(180/Math.PI);
    NowPointMin=180+Math.atan2((0.5*FromHeight-window.event.clientX),(window.event.y-0.5*FromHeight))*(180/Math.PI);
    rectHour.rotation=Math.floor(rectHour.rotation/30)*30+NowPointMin/12;
    OldPointMin=NowPointMin/6;

    }
    else if(((window.event.y-0.5*FromHeight)<=0) && ((window.event.clientX-0.5*FromHeight)<0))
    {
    if (OldPointMin<15)
    {
    rectHour.rotation=Math.floor(rectHour.rotation/30)*30-30;

    }
    MinfillColor.angle=360-Math.atan2((0.5*FromHeight-window.event.clientX),(0.5*FromHeight-window.event.y))*(180/Math.PI);
        rectMinter.rotation=360-Math.atan2((0.5*FromHeight-window.event.clientX),(0.5*FromHeight-window.event.y))*(180/Math.PI);
    NowPointMin=360-Math.atan2((0.5*FromHeight-window.event.clientX),(0.5*FromHeight-window.event.y))*(180/Math.PI);
    rectHour.rotation=Math.floor(rectHour.rotation/30)*30+NowPointMin/12;
    OldPointMin=NowPointMin/6;


    }

    MondifyMinuter=Math.floor((rectHour.rotation-Math.floor(rectHour.rotation/30)*30)*2);
    } MondifyHour=Math.floor(rectHour.rotation/30);


    if (MondifyHour<0)
    {
    MondifyHour=12-Math.abs(MondifyHour-Math.ceil(MondifyHour/12)*12);
    }
    document.all("MondifyTime").value=Math.floor(rectHour.rotation/30)+","+MondifyHour+":"+MondifyMinuter;
    }
    }
    function OutPoint()
    {
    if(!BeginDrag)
    document.body.style.cursor="default";
    }
    function OverPoint()
    {
    document.body.style.cursor="hand";
    }
    function DownPoint(nstr)
    {
    BeginDrag=true;
    DragObject=nstr;
    document.body.onmousemove=MovePoint;
    document.body.onmouseup=DragStop;

    }
      

  29.   

    function DragStop()
    {
    BeginDrag=false;
    OutPoint();
    if (DragObject=="rectHour")
    {
    rectMinter.rotation=(rectHour.rotation-Math.floor(rectHour.rotation/30)*30)*12;
    }
    OldPointMin=0;
    DragObject="none";
    document.body.onmouseup="";
    document.body.onmousemove="";
    }
    function InitFrom()
    {
    var imgbg=document.createElement("img");
    imgbg.src="image/Watchbg.gif";
    imgbg.style.width=FromHeight+nUnit;
    imgbg.style.height=FromWidth+nUnit;
    ClockSpan.appendChild(imgbg);
    //center
    var ClockCenter=document.createElement("v:oval");
    ClockCenter.style.position="absolute";
    ClockCenter.style.top=0.47*FromHeight+nUnit;
    ClockCenter.style.left=0.47*FromWidth+nUnit;
    ClockCenter.style.width=0.06*FromHeight+nUnit;
    ClockCenter.style.height=0.06*FromHeight+nUnit;
    ClockCenter.style.zIndex="4";
    ClockCenter.strokecolor= '#9591EE';
    var fileColor=document.createElement("v:fill");
    fileColor.type='gradient';
    fileColor.color2 = 'green';
    fileColor.angle = '1200';
    ClockCenter.appendChild(fileColor);
    ClockSpan.appendChild(ClockCenter);

    //hourspoint
    rectHour=document.createElement("v:shape");
    rectHour.coordorigin="0 0";
    rectHour.coordsize="1000 1000";
    rectHour.style.position="absolute";
    rectHour.style.width=FromHeight+nUnit;
    rectHour.style.height=FromWidth+nUnit;
    rectHour.style.top="0"+nUnit;
    rectHour.style.left="0"+nUnit;
    rectHour.fillcolor = '#000000';
    rectHour.strokecolor= '#9591EE';
    rectHour.style.zIndex="2";
    rectHour.path = 'm 490,300 l 510,300, 520,560, 480,560 xe';
    var RectShaw=document.createElement("v:shadow");
    RectShaw.on='t';
    RectShaw.type='single';
    RectShaw.offset=0.015*FromHeight+nUnit+','+0.015*FromHeight+nUnit;
    rectHour.appendChild(RectShaw);
    HourfillColor=document.createElement("v:fill");
    HourfillColor.type='gradient';
    HourfillColor.color2 = '#8380FF';
    HourfillColor.angle = '180';
    rectHour.appendChild(HourfillColor);
    ClockSpan.appendChild(rectHour);

    //minterpoint
    rectMinter=document.createElement("v:shape");
    rectMinter.coordorigin="0 0";
    rectMinter.coordsize="1000 1000";
    rectMinter.style.position="absolute";
    rectMinter.style.width=FromHeight+nUnit;
    rectMinter.style.height=FromWidth+nUnit;
    rectMinter.style.top="0"+nUnit;
    rectMinter.style.left="0"+nUnit;
    rectMinter.fillcolor = '#000000';
    rectMinter.strokecolor= '#9591EE';
    rectMinter.style.zIndex="2";
    rectMinter.path = 'm 490,200 l 510,200, 520,600, 480,600 xe';
    RectShaw=document.createElement("v:shadow");
    RectShaw.on='t';
    RectShaw.type='single';
    RectShaw.offset=0.015*FromHeight+nUnit+','+0.015*FromHeight+nUnit;
    rectMinter.appendChild(RectShaw);
    MinfillColor=document.createElement("v:fill");
    MinfillColor.type='gradient';
    MinfillColor.color2 = '#8380FF';
    MinfillColor.angle = '180';
    rectMinter.appendChild(MinfillColor);
    ClockSpan.appendChild(rectMinter);

    //secondpoint
    rectSecond=document.createElement("v:shape");
    rectSecond.coordorigin="0 0";
    rectSecond.coordsize="1000 1000";
    rectSecond.style.position="absolute";
    rectSecond.style.width=FromHeight+nUnit;
    rectSecond.style.height=FromWidth+nUnit;
    rectSecond.style.top="0"+nUnit;
    rectSecond.style.left="0"+nUnit;
    rectSecond.fillcolor = '#000000';
    rectSecond.strokecolor= '#000000';
    rectSecond.StrokeWidth="0"+nUnit;
    rectSecond.style.zIndex="2";
    rectSecond.path = 'm 495,150 l 505,150, 505,600, 495,600 xe';
    RectShaw=document.createElement("v:shadow");
    RectShaw.on='t';
    RectShaw.type='single';
    RectShaw.offset=0.015*FromHeight+nUnit+','+0.015*FromHeight+nUnit;
    rectSecond.appendChild(RectShaw);
    ClockSpan.appendChild(rectSecond);
    //set first time

     ClockTime=document.createElement("input");
     ClockTime.type="text";
     ClockTime.style.top=FromHeight;
     ClockTime.style.left=FromWidth;
     ClockSpan.appendChild(ClockTime);
     if (!ChangeMolde)
     {
    document.ondragstart=new Function ("return false");
    document.onselectstart=new Function ("return false");
    SetTime(0);
     }
    }</script>
    <style>
    v\:* { behavior: url(#default#VML); }</style>
    </head>
    <body  bgcolor=Gainsboro onload="InitFrom()">
    <span id=ClockSpan name=ClockSpan style="position:absolute;width:100;height:100;top:0pt;left:0pt"></span><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
    <BR>
    <INPUT type="button" onclick="MoldeChanged()" value="Button" id=button1 name=button1>
    <INPUT type="text" id=MondifyTime name=MondifyTime>
    </body>
    </html>
      

  30.   

    那以上的代码放在哪里?
    ————————
    放在主JSP中啊,
    就是你那个包含IFRAME的页面
      

  31.   

    ****
    BODY.JSP
    ***
    不刷新的:<span id=palySan >
    </span><iframe src="tmp.jsp" id=tmpFrame>
    </iframe>
    *****
    tmp.jsp
    *****
    ------
    <html>
    <META HTTP-EQUIV="REFRESH" CONTENT="x; URL=tmp.jsp">  <!--用一下哈哈--!>
    <%
    ....
    String objValue="你要显示的";
    %>
    </html>
    <script language=JavaScript>
    parent.document.all.palySan.innerHTML="<%=objValue%>"
    </script>------
      

  32.   

    好多高人啊,呵呵,学习!to jianlin (妞妞)  在frameset中把rows或者cols设置成"0,*"就可以隐藏frame了。
      

  33.   

    to  jianlin(妞妞) 
    把左边的列设成0 就行了
    cols="0,*" to ManFirst(ManFirst)
    javascript 牛人呀,有时间看看你的代码,完成了什么功能?save
      

  34.   

    to ManFirst(ManFirst) 
    能不能给点注释呀!!
    好长好长,o 的眼睛都看花了,谢谢。
      

  35.   

    写JAVASCRIPT没有意思,但是WEB开发你不能没有它。
    点缀的东西嘛。。
    学JAVA就把多线程学好吧。
      

  36.   

    你点一下BUTTON,可以调整时钟的。
      

  37.   

    to ManFirst
      不好意思,iframe怎么用。我现在可以显示了,但是要显示的东西只有一小块,其他地方都是空的,为什么?
      

  38.   

    *****
    to ManFirst
      不好意思,iframe怎么用。我现在可以显示了,但是要显示的东西只有一小块,其他地方都是空的,为什么?
    ********
    不明白,
    IFRAME内部帧,
    FRAMES框架也。