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>  
)

Javascript刷新页面的几种方法:的更多相关文章

  1. Javascript刷新页面的几种方法

    Javascript刷新页面的几种方法: window.navigate(location)location.reload()location=locationlocation.assign(loca ...

  2. Javascript刷新页面的八种方法

    /** * Javascript刷新页面的八种方法 * 说明一下,jQuery没有发现刷新页面的方法. */ 1 history.go(0) 2 location.reload() 3 locatio ...

  3. JS刷新页面的几种方法(转)

    Javascript刷新页面的几种方法: 1 history.go(0) 2 location.reload() 3 location=location 4 location.assign(locat ...

  4. js刷新页面的几种方法

    history.go(0) location.reload() location=location location.assign(location) document.execCommand('Re ...

  5. javascript刷新页面的方法

    Javascript刷新页面的几种方法: 1 history.go(0) 2 location.reload() 3 location=location 4 location.assign(locat ...

  6. Javascript刷新页面大全

    非模态刷新父页面:window.opener.location.reload(); 模态刷新父页面:window.dialogArguments.location.reload(); 先来看一个简单的 ...

  7. js刷新页面的几种方式与区别

    Javascript刷新页面的几种方法:1 history.go(0) 2 location.reload() 3 location=location 4 location.assign(locati ...

  8. JS刷新当前页面的几种方法总结

    reload 方法,该方法强迫浏览器刷新当前页面. 语法:location.reload([bForceGet]) 参数: bForceGet, 可选参数, 默认为 false,从客户端缓存里取当前页 ...

  9. javascript刷新页面代码

    原文链接:http://caibaojian.com/javascript-refresh-page.html reload 方法,该方法强迫浏览器刷新当前页面. 语法:location.reload ...

随机推荐

  1. poj 2046 Gap(bfs+hash)

    Description Let's play a card game called Gap. You have cards labeled with two-digit numbers. The fi ...

  2. UltraEdit 和Notepad++ 使用ftp直接编辑linux上文件

    安装ftp服务 apt-get install vsftpd 安装完后更改相关配置文件 /etc/vsftpd.conf cp /etc/vsftpd.conf /etc/vsftpd.conf.ol ...

  3. 【计算机视觉】基于行为的ReID演示

    帮老师做了一个简单的基于行为(主要是步态)的ReID问题的Demo,效果例如以下图: 以下是提取的集中特征,前三个都是GEI系的,后几个是基于光流场的.然后右边是识别出的几个对象的排序,由于没有角度和 ...

  4. qt 3d 绘图

    首先不得不说,要感谢北京邮电大学的阿科.感谢他慷慨的分享和极具科学态度的记录,将自己搜集到的众多资料收集整理发布,拯救众多苦逼寻找方案的程序员于苦海之中.因为最近接手新的项目,涉及到使用opengl做 ...

  5. _js day11

  6. ajax请求webservice时抛出终止线程的异常

    请求webservice中以下接口,会抛出异常 {"Message":"正在中止线程.","StackTrace":" 在 Sys ...

  7. angular 指令梳理 —— checkBox

    checkBox 持久化数据为 逗号分割 /** * 功能说明: * htCheckbox 指令用于收集checkbox数据. * 在页面中使用 * 属性指令:ht-checkbox * 对应的值为s ...

  8. C#创建Windows服务的几个注意事项

    1.服务安装后的自动启动:服务的StartType即使配置成Automatic,在首次安装成功之后还是要在服务列表中找到并手工启动.此外,可以通过在ProjectInstaller中添加AfterIn ...

  9. 利用java Base64 实现加密、解密

    Base64加密解密 package com.stone.util; import java.io.UnsupportedEncodingException; import sun.misc.*; p ...

  10. 解决Sublime-Text-3在ubuntu下中文输入的问题

    在ubuntu下使用ST这神器已经一段日子了,但是一直有个纠结的问题,就是中文输入非常坑爹,曾经一段时间,使用inputHelper这个插件来解决, 但是……每次都要按个快捷键,弹出一个小小小框来输入 ...