江门电台98.3节目表:javascript/js 自动刷新页面和页面跳转的实现方法(自动执行)

来源:百度文库 编辑:中财网 时间:2024/04/28 07:15:23

javascript/js 自动刷新页面和页面跳转的实现方法(自动执行)

    博客分类:
  • JavaScript相关
JavaScript框架ASPJSP脚本Java代码  
  1. 1)   
  2. "refresh"content="10;url=跳转的页面">   
  3. 10表示间隔10秒刷新一次   
  4. 2)   
  5. ''javascript''>   
  6. window.location.reload(true);   
  7.   
  8. 如果是你要刷新某一个iframe就把window给换成frame的名字或ID号   
  9. 3)   
  10. ''javascript''>   
  11. window.navigate("本页面url");   
  12.   
  13. 4>   
  14.   
  15. function abc()   
  16. {   
  17. window.location.href="/blog/window.location.href";   
  18. setTimeout("abc()",10000);   
  19. }   
  20.   
  21. 刷新本页:   
  22. Response.Write("window.location.href=window.location.href;")   
  23.   
  24. 刷新父页:   
  25. Response.Write("opener.location.href=opener.location.href;")   
  26.   
  27. 转到指定页:   
  28. Response.Write("window.location.href='yourpage.aspx';")   
  29.   
  30.   
  31. 刷新页面实现方式总结(HTML,ASP,JS)   
  32. 'by aloxy   
  33.   
  34. 定时刷新:   
  35. 1   
  36.   
  37. 说明:url是要刷新的页面URL地址   
  38. 2000是等待时间=2秒,   
  39.   
  40. 2"Refresh" content="n;url">   
  41.   
  42. 说明:   
  43. n is the number of seconds to wait before loading the specified URL.   
  44. url is an absolute URL to be loaded.   
  45. n,是等待的时间,以秒为单位   
  46. url是要刷新的页面URL地址   
  47.   
  48. 3,<%response.redirect url%>   
  49.   
  50. 说明:一般用一个url参数或者表单传值判断是否发生某个操作,然后利用response.redirect 刷新。   
  51.   
  52. 4,刷新框架页   
  53.    〈script language=javascript>top.leftFrm.location.reload();parent.frmTop.location.reload();
  54.   
  55. 弹出窗体后再刷新的问题   
  56.   
  57.   
  58. Response.Write("");//open   
  59.              Response.Write("");   
  60.   
  61. 在子窗体页面代码head中加入"_self"/>   
  62.   
  63. 刷新的内容加在    if (!IsPostBack) 中   
  64.   
  65. 在框架页中右面刷新左面   
  66.     //刷新框架页左半部分   
  67.     Response.Write("");   
  68.     Response.Write("parent.left.location.href='PayDetailManage_Left.aspx'");   
  69.     Response.Write("");   
  70.   
  71.   
  72. 页面定时刷新功能实现   
  73.   
  74. 有三种方法:   
  75. 1,在html中设置:   
  76. xxxxx之後加入下面这一行即可!   
  77. 定时刷新:"Refresh" content="10">   
  78. 10代表刷新间隔,单位为秒   
  79.   
  80. 2.jsp   
  81. <% response.setHeader("refresh","1"); %>   
  82. 每一秒刷新一次   
  83.   
  84. 3.使用javascript:   
  85. "javascript">   
  86. setTimeout("self.location.reload();",1000);   
  87.   
  88.   
  89. //第二个刷新父页面的函数   
  90.   
  91. "javascript">   
  92. opener.location.reload();   
  93.   
  94.   
  95.   
  96. //第三个打开窗口   
  97.   
  98. "javascript">   
  99. function show(mylink,mytitle,width,height)   
  100. {mailwin=window.open(mylink,mytitle,'top=350,left=460,width='+width+',height='+height+',scrollbars=no')}   
  101.   
  102.   
  103.   
  104.   
  105. js刷新父页面   
  106. 非模态刷新父页面:window.opener.location.reload();    
  107. 模态刷新父页面:window.dialogArguments.location.reload();    
  108.   
  109. Response.Write("\r\n");    
  110. Response.Write("\r\n"); //关闭脚本块    
  111. }    
  112. 上面的代码就是关闭对话框和刷新父页的代码,这段代码也可以直接写入editdata.aspx的html中,然后在后台cs中调用   
  113.   
  114.   
  115.