Javascript刷新页面的几种方法:
1    history.go(0)
2    window.location.reload()

window.location.reload(true) 
3    location=location
4    location.assign(location)
5    document.execCommand(''Refresh'')
6    window.navigate(location)
7    location.replace(location)
8    document.URL=location.href

Frame框架:

frame.html:

<frameset rows="50%,50%">
       <frame name=top src="top.html">
       <frame name=bottom src="bottom.html">
    </frameset>

七种语句:

语句1. window.parent.frames[1].location.reload();
    语句2. window.parent.frames.bottom.location.reload();
    语句3. window.parent.frames["bottom"].location.reload();
    语句4. window.parent.frames.item(1).location.reload();
    语句5. window.parent.frames.item(''bottom'').location.reload();
    语句6. window.parent.bottom.location.reload();
    语句7. window.parent[''bottom''].location.reload();

top.html 页面的代码如下:
<input type=button value="刷新1" onclick="window.parent.frames[1].location.reload()">

bottom.html页面:

<body onload="alert(''我被加载了!'')">
      <h1>This is the content in bottom.html.</h1>
    </body>

1.window指代的是当前页面,例如对于此例它指的是top.html页面。
    2.parent指的是当前页面的父页面,也就是包含它的框架页面。例如对于此例它指的是frame.html。
    3.frames是window对象,是一个数组。代表着该框架内所有子页面。
    4.item是方法。返回数组里面的元素。
    5.如果子页面也是个框架页面,里面还是其它的子页面,那么上面的有些方法可能不行。

如果想关闭窗口时刷新或者想开窗时刷新的话,在<body>中调用以下语句即可。

<body onload="opener.location.reload()"> 开窗时刷新
    <body onUnload="opener.location.reload()"> 关闭时刷新

//子窗口刷新父窗口
<script language=JavaScript>
    self.opener.location.reload();
</script>
( 或 <a href="javascript:opener.location.reload()">刷新</a>   )


转自:http://blog.sina.com.cn/s/blog_780a942701012vip.html

js 刷新页面window.location.reload();的更多相关文章

  1. js刷新页面window.location.reload()

    window.location.reload()刷新当前页面 window.parent.location.reload()刷新父亲对象(用于框架) opener.location.reload()刷 ...

  2. js刷新页面location.reload()用法

    转: js刷新页面location.reload()用法 2018年05月10日 10:23:28 大灰狼的小绵羊哥哥 阅读数 31359更多 分类专栏: [前端面试点滴知识 ]   本文介绍了js刷 ...

  3. js刷新页面 location.reload()

    在javascript编程中,多使用location.reload实现页面刷新. 例子: 代码示例: window.location.href=window.location.href; window ...

  4. window.location.reload();页面实现跳转和刷新

    1 history.go(0)2 location.reload()3 location=location4 location.assign(location)5 document.execComma ...

  5. javascript:window.location.replace 与 window.location.reload() 刷新页面的不同效果

    今天早上我发现一个问题,当一个网页的地址最后面是一个#时(比如:http://www.baidu.com/go.asp#), 执行:window.location.replace(window.loc ...

  6. 解决微信浏览器无法使用window.location.reload()刷新页面

    解决方法: 使用    window.location.href=window.location.href+随机数    代替 window.location.reload(). function r ...

  7. Dynamics CRM2013 Form利用window.location.reload()进行全局刷新带来的问题及解决办法

    CRM2013以后,表单的保存后变成了局部刷新而非全局刷新,但很多情况下我们需要刷新整个页面,通过刷新页面来使脚本执行或者业务规则执行来实现某些业务效果,一般我们会使用window.location. ...

  8. Dynamics CRM2013 Form利用window.location.reload()进行全局刷新带来的问题及解决的方法

    CRM2013以后.表单的保存后变成了局部刷新而非全局刷新,但非常多情况下我们须要刷新整个页面.通过刷新页面来使脚本运行或者业务规则运行来实现某些业务效果,一般我们会使用window.location ...

  9. js刷新页面方法大全

    如何实现刷新当前页面呢?借助js你将无所不能. 1,reload 方法,该方法强迫浏览器刷新当前页面.语法:location.reload([bForceGet])   参数: bForceGet, ...

随机推荐

  1. MapReduce工作流多种实现方式

    学习 hadoop,必不可少的就是编写 MapReduce 程序.当然,对于简单的分析程序,我们只需一个 MapReduce 任务就能搞定,然而对于比较复杂的分析程序,我们可能需要多个Job或者多个M ...

  2. Centos 6.5 Percona 5.6.27 Tokudb 配置

    参考 https://www.percona.com/doc/percona-server/5.6/tokudb/tokudb_installation.html # wget https://www ...

  3. 1.uniq去重命令讲解

    uniq命令: 常见参数: -c,--count *****      在每行旁边显示改行重复出现的次数 -d,--repeated        仅显示重复出现的行,2次或2次以上的行,默认的去重包 ...

  4. Apache与Nginx的优缺点比较

    1.nginx相对于apache的优点: 轻量级,同样起web 服务,比apache 占用更少的内存及资源 抗并发,nginx 处理请求是异步非阻塞的,而apache 则是阻塞型的,在高并发下ngin ...

  5. ubuntu kylin 14.04安装配置MongoDB v2.6.1(转)

    1.获取最新版本 https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.1.tgz 2.解压并进入bin目录 tar zxvf mongo ...

  6. 安卓APP与智能硬件相结合的简易方案

    第1章 概  述 (作者小波QQ463431476) (来源http://blog.chinaaet.com/zhaocundang/p/5100017645博客) (来源   http://www. ...

  7. Key words

    Key words ACL - Access Control List IDS - Intrusion Dection Systems ASLR - Address-Space Layout Rand ...

  8. 斐波拉契数列(Fibonacci) 的python实现方式

    第一种:利用for循环 利用for循环时,不涉及到函数,但是这种方法对我种小小白来说比较好理解,一涉及到函数就比较抽象了... >>> fibs = [0,1] >>&g ...

  9. jQuery 常用速查

    jQuery 速查 基础 $("css 选择器") 选择元素,创建jquery对象 $("html字符串") 创建jquery对象 $(callback) $( ...

  10. 5G关键技术评述

    业内重大事件: 张  平:无线通信领域专家,北京邮电大学教授,博士生导师,现任北京邮电大学无线新技术研究所(WTI)所长.泛网无线通信教育部重点实验室主任以及中德软件研究所副所长.张平教授是国家宽带无 ...