1. 程式人生 > >頁面重新整理 方法總結 JSP重新整理

頁面重新整理 方法總結 JSP重新整理

   1)

  <metahttp-equiv="refresh"content="10;url=跳轉的頁面">

  10表示間隔10秒重新整理一次

  2)

  <scriptlanguage=''javascript''>

  window.location.reload(true);

  </script>

  如果是你要重新整理某一個iframe就把window給換成frame的名字或ID號

  3)

  <scriptlanguage=''javascript''>

  window.navigate("本頁面url");

  </script>

  4)

  function abc()

  {

  window.location.href="/blog/window.location.href";

  setTimeout("abc()",10000);

  }

  重新整理本頁:

  Response.Write("<scriptlanguage=javascript>window.location.href=window.location.href;</script>")

  重新整理父頁:

  Response.Write("<scriptlanguage=javascript>opener.location.href=opener.location.href;</script>")

  轉到指定頁:

  Response.Write("<scriptlanguage=javascript>window.location.href='yourpage.aspx';</script>")

  

   重新整理頁面實現方式總結(HTML,ASP,JS)

  'by aloxy

  定時重新整理:

  1,<script>setTimeout("location.href='url'",2000)</script>

  說明:url是要重新整理的頁面URL地址

  2000是等待時間=2秒,

  2,<meta name="Refresh"content="n;url">

  說明:

  n,是等待的時間,以秒為單位

  url是要重新整理的頁面URL地址

  3,<%response.redirect url%>

  說明:一般用一個url引數或者表單傳值判斷是否發生某個操作,然後利用response.redirect 重新整理。

  4,重新整理框架頁

  〈scriptlanguage=javascript>top.leftFrm.location.reload();parent.frmTop.location.reload();</script〉 


  彈出窗體後再重新整理的問題

  Response.Write("<script>window.showModalDialog('../OA/SPCL.aspx',window,'dialogHeight:300px; dialogWidth: 427px; dialogTop: 200px; dialogLeft:133px')</script>");//open

  Response.Write("<script>document.location=document.location;</script>");

  在子窗體頁面程式碼head中加入<basetarget="_self"/>

  重新整理的內容加在   if (!IsPostBack) 中

  在框架頁中右面重新整理左面

  //重新整理框架頁左半部分

  Response.Write("<scriptlanguage=javascript>");

  Response.Write("parent.left.location.href='PayDetailManage_Left.aspx'");

  Response.Write("</script>");

  頁面定時重新整理功能實現

  有三種方法:

  1,在html中設定:

  <title>xxxxx</title>之後加入下面這一行即可!

  定時重新整理:<META HTTP-EQUIV="Refresh"content="10">

  10代表重新整理間隔,單位為秒

  2.jsp

  <% response.setHeader("refresh","1");%>

  每一秒重新整理一次

  3.使用javascript:

  <scriptlanguage="javascript">

  setTimeout("self.location.reload();",1000);

  <script>

  一秒一次

  頁面自動跳轉:

  1,在html中設定:

  <title>xxxxx</title>之後加入下面這一行即可!

  定時跳轉並重新整理:<meta http-equiv="refresh"content="20;url=http://自己的URL">,

  其中20指隔20秒後跳轉到http://自己的URL 頁面。

  點選按鈕提交表單後重新整理上級視窗

  A視窗開啟B視窗

  然後在B裡面提交資料至C視窗

  最後要重新整理A視窗

  並且關閉B視窗

  幾個javascript函式

  //第一個自動關閉視窗

  <scriptlanguage="javascript">

  <!--

  function clock(){i=i-1

  document.title="本視窗將在"+i+"秒後自動關閉!";

  if(i>0)setTimeout("clock();",1000);

  else self.close();}

  var i=2

  clock();

  //-->

  </script>

  //第二個重新整理父頁面的函式

  <scriptlanguage="javascript">

  opener.location.reload();

  </script>

  //第三個開啟視窗

  <scriptlanguage="javascript">

  function show(mylink,mytitle,width,height)

  {mailwin=window.open(mylink,mytitle,'top=350,left=460,width='+width+',height='+height+',scrollbars=no')}

轉自:http://hi.baidu.com/zijie410/blog/item/ab71d0d1782cbf81a0ec9cf2.html