易截截图软件、单文件、免安装、纯绿色、仅160KB

Javascript刷新页面的几种方法

Javascript刷新页面的几种方法:
程序代码
1    history.go(0) 
2    location.reload() 
3    location=location 
4    location.assign(location) 
5    document.execCommand('Refresh') 
6    window.navigate(location) 
7    location.replace(location) 
8    document.URL=location.href 
自动刷新页面的方法:
1.页面自动刷新:把如下代码加入<head>区域中
程序代码
<meta http-equiv="refresh" content="20">
其中20指每隔20秒刷新一次页面.
2.页面自动跳转:把如下代码加入<head>区域中
程序代码
<meta http-equiv="refresh" content="20;url=http://www.wyxg.com">
其中20指隔20秒后跳转到http://www.wyxg.com页面
3.页面自动刷新js版
程序代码
<script language="JavaScript">
function myrefresh()
{
       window.location.reload();
}
setTimeout('myrefresh()',1000); //指定1秒刷新一次
</script>
JS刷新框架的脚本语句
程序代码
//如何刷新包含该框架的页面用   
<script language=JavaScript>
   parent.location.reload();
</script>   
//子窗口刷新父窗口
<script language=JavaScript>
    self.opener.location.reload();
</script>
( 或 <a href="javascript:opener.location.reload()">刷新</a>   )
//如何刷新另一个框架的页面用   
<script language=JavaScript>
   parent.另一FrameID.location.reload();
</script>
如果想关闭窗口时刷新或者想开窗时刷新的话,在<body>中调用以下语句即可。
<body onload="opener.location.reload()"> 开窗时刷新
<body onUnload="opener.location.reload()"> 关闭时刷新
<script language="javascript">
window.opener.document.location.reload()


相关文档:

一个带CheckBox的树形目录的递归算法(javascript)

原创于2007年12月16日,2009年10月15日迁移至此。
唉,很久以前写的代码,晒一晒,估计自己看都看不懂了,:(
var head="display:''"
img_close=new Image()
img_close.src="/sysManage/images/f.gif"
img_open=new Image()
img_open.src="/sysManage/images/fo.gif"
img3=new Image( ......

JavaScript中定义类或对象


1,对象的构成
对象有特性构成(attribute),可以是原始值,也可以是引用值。如果特性存放的是函数,它将被看做对象的方法(method),否则该特性被看做属性(property)。
2,定义类或对象
(1)工厂方式
Code
    function createCar(sColor,iDoors) {
    &nb ......

Javascript 中的小知识点整理

1, js中的类数组对象
   (1) arguments对象:
 function(){
//arguments对象是Arguments对象实例,是一个类数组对象,并拥有下列方法
alert(arguments instanceof Array);//false
arguments.callee(); //对自身的调用, 用于递归
var c = arguments.caller; //对调用自身函数的父函数, 如果 ......

JavaScript 继承详解4

在本章中,我们将分析Douglas Crockford关于JavaScript继承的一个实现
Crockford是JavaScript开发社区最知名的权威,是JSON
、JSLint
、JSMin
和ADSafe
之父,是《JavaScript: The Good Parts》的作者。
现在是Yahoo的资深JavaScript架构师,参与YUI的设计开发。 这里有一篇文章
详细介绍了Crockford的生平和著作。 ......

一个简单横向javascript日期控件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title> new document </title>
  <meta name="generator" content="edit ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号