idcbe.com
Tag: JS预览模式: 普通 | 列表

JS实现页面定时跳转/自动重定向

以下代码来源于网络,有效,可直接使用。本人亦作了一点点优化。

<script language="javascript" type="text/javascript">
 var hwd;
 var intSec = 3;//这里定义时间:秒
 function reHandle()
 {
  if(intSec==0)
  window.location.href = 'http://edwin.jkqun.com/blog/article.asp?id=245';
  else
  {
  intSec--;
  }
  hwd = setTimeout(reHandle,1000);
 }
  reHandle();
  document.write('<p><span id="tiao">'+intSec+'</span>秒后自动跳转…</p>')
</script>

Tags: JS 定时 页面跳转 重定向 代码

分类:网站建设 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 11994

在iframe里刷新父窗口的JS语句

找了很久才找到!
在iframe里刷新父窗口的JS语句,如何在子窗口中刷新父窗口,js刷新父窗口,iframe子窗口刷新父窗口,Javascript语句:

只需在iframe的子窗口里的页面中加入JS语句:
parent.location.replace(parent.location.href);

查看更多...

Tags: iframe JS 父窗口 子窗口

分类:网站建设 | 固定链接 | 评论: 1 | 引用: 0 | 查看次数: 12338