<iframe src="1.htm" name="ifrmname" id="ifrmid"></iframe>

方案一:用iframe的name属性定位

<input type="button" name="Button" value="Button"
onclick="document.frames('ifrmname').location.reload()">

  或

<input type="button" name="Button" value="Button"
onclick="document.all.ifrmname.document.location.reload()">

  方案二:用iframe的id属性定位

<input type="button" name="Button" value="Button"
onclick="ifrmid.window.location.reload()">

  终极方案:当iframe的src为其它网站地址(跨域操作时)

<input type="button" name="Button" value="Button"
onclick="window.open(document.all.ifrmname.src,'ifrmname','')">

代码如下:<input type=button value=刷新 onclick="history.go(0)">

代码如下:<input type=button value=刷新 onclick="location.reload()">

代码如下:<input type=button value=刷新 onclick="location=location">

代码如下:<input type=button value=刷新 onclick="window.navigate(location)">

代码如下:<input type=button value=刷新 onclick="location.replace(location)">

下面这三种我就不知道该怎么用了,就把代码放在下面吧,哪位要是会的话,可教教大家。

<input type=button value=刷新 onclick="document.execCommand(@#Refresh@#)">

<input type=button value=刷新 onclick="window.open(@#自身的文件@#,@#_self@#)">

<input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)>

父页面中存在两个iframe,一个iframe中是一个链接列表,其中的链接指向另一个iframe,用于显示内容。现在当内容内容添加后,在链接列表中添加了一条记录,则需要刷新列表iframe。

在内容iframe的提交js中使用parent.location.reload()将父页面全部刷新,因为另一个iframe没有默认的url,只能通过列表选择,所以只显示了列表iframe的内容。

使用window.parent.frames["列表iframe名字"].location="列表url"即可进刷新列表iframe,而内容iframe在提交后自己的刷新将不受影响。

document.frames("refreshAlarm").location.reload(true); //ok

document.frames("refreshAlarm").document.location.reload(true); //ok

document.frames("refreshAlarm").document.location="/public/alarmsum.asp";//ok

document.getElementByIdx_x("refreshAlarm").src="/public/alarmsum.asp" mce_src="/public/alarmsum.asp"; //ok

document.frames("refreshAlarm").src="/public/alarmsum.asp" mce_src="/public/alarmsum.asp"; //没变化,没动静

注意区别,document.all.refreshAlarm 或 document.frames("refreshAlarm") 得到的是information.asp页面中那个iframe标签,所以对src属性操作有用。
document.frames("refreshAlarm").document得到iframe里面的内容,也就是"/public/alarmsum.asp"中的内容。

这里需要补充说明的是:

采用document.getElementByIdx_x获取后reload是不可以的

但是可以这样

var myiframe = document.getElementByIdx_x("iframe1");

myiframe.src = myiframe.src; //这样同样可以起到刷新的效果。

自动刷新页面

javascript(js)自动刷新页面的实现方法总结2008-04-18 13:24
自动刷新页面的实现方法总结:

1)
<meta http-equiv="refresh"content="10;url=跳转的页面">
10表示间隔10秒刷新一次
2)
<script language=''javascript''>
window.location.reload(true);
</script>
如果是你要刷新某一个iframe就把window给换成frame的名字或ID号
3)
<script language=''javascript''>
window.navigate("本页面url");
</script>
4>

function abc()
{
window.location.href="/blog/window.location.href";
setTimeout("abc()",10000);
}

刷新本页:
Response.Write("<script language=javascript>window.location.href=window.location.href;</script>")

刷新父页:
Response.Write("<script language=javascript>opener.location.href=opener.location.href;</script>")

转到指定页:
Response.Write("<script language=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 is the number of seconds to wait before loading the specified URL.
url is an absolute URL to be loaded.
n,是等待的时间,以秒为单位
url是要刷新的页面URL地址

3,<%response.redirect url%>

说明:一般用一个url参数或者表单传值判断是否发生某个操作,然后利用response.redirect 刷新。

4,刷新框架页
   〈script language=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中加入<base target="_self"/>

刷新的内容加在    if (!IsPostBack) 中

在框架页中右面刷新左面
    //刷新框架页左半部分
    Response.Write("<script language=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:
<script language="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函数

//第一个自动关闭窗口
<script language="javascript">
<!--
function clock(){i=i-1
document.title="本窗口将在"+i+"秒后自动关闭!";
if(i>0)setTimeout("clock();",1000);
else self.close();}
var i=2
clock();
//-->
</script>

//第二个刷新父页面的函数

<script language="javascript">
opener.location.reload();
</script>

//第三个打开窗口

<script language="javascript">
function show(mylink,mytitle,width,height)
{mailwin=window.open(mylink,mytitle,'top=350,left=460,width='+width+',height='+height+',scrollbars=no')}
</script>

JS实现刷新iframe的方法的更多相关文章

  1. js实现刷新iframe的方法汇总

    https://www.jb51.net/article/65013.htm javascript实现刷新iframe的方法的总结,现在假设存在下面这样一个iframe,则刷新该iframe的N种方法 ...

  2. JS、jQuery 刷新 iframe 的方法

    1.JavaScript 刷新 iframe 可以使用以下方法: document.getElementById('some_frame_id').contentWindow.location.rel ...

  3. JS 中刷新页面的方法

    整理了就是这几种,,有些在IE下面是不支持的,慎用... 1,history.go(0) 2,location.reload() 3,location=location 4,location.assi ...

  4. js禁止刷新的简单方法

    //禁止用F5键  这个是键盘按下时触发document.onkeydown = function() { if ( event.keyCode==116) {event.keyCode = 0; e ...

  5. 【转】js/jquery中刷新iframe方法(兼容主流)

    一.js实现刷新两种方式: 1.//方法1 2.document.getElementById('FrameID').contentWindow.location.reload(true); 3.// ...

  6. js返回上一页并刷新的多种方法

    js返回上一页并刷新的几种方法.参考链接:http://www.jbxue.com/article/11230.html <a href="javascript:history.go( ...

  7. 谷歌、火狐浏览器下实现JS跨域iframe高度自适应的完美解决方法,跨域调用JS不再是难题!

    谷歌.火狐浏览器下实现JS跨域iframe高度自适应的解决方法 导读:今天开发的时候遇到个iframe自适应高度的问题,相信大家对这个不陌生,但是一般我们都是在同一个项目使用iframe嵌套页面,这个 ...

  8. jquery刷新iframe页面的方法(兼容主流)

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

  9. js和php刷新页面的方法

    js中3个最优的刷新页面的方法 window.location.reload(): window.history.go(0): document.execCommand(''Refresh''): p ...

随机推荐

  1. 坑到了,EF执行带事物的存储过程

    用EF开发项目,今天调用 带事物 存储过程,始终报错,"EXECUTE 后的事务计数指示 BEGIN 和 COMMIT 语句的数目不匹配.上一计数 = 1,当前计数 = 0.\r\nEXEC ...

  2. 解决ashx文件下的Session“未将对象引用设置到对象的实例”

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using PPT_DAL; ...

  3. 使用SSIS创建同步数据库数据任务

    国外相关的文章:http://blog.dxuf.com/sql-tutorial/use-ssis-to-create-the-synchronization-database-data-task. ...

  4. .net上传图片并转成二进制流

    话不多说,直接上代码 <input id="InputFile" style="width: 399px" type="file" r ...

  5. 备忘-zTree v3.5 Demo 演示

    zTree v3.5 Demo 演示: http://www.ztree.me/v3/demo.php#_110

  6. CookieHelper JS封装Cookie 存取方法

    微信的一些页面会去获取授权,然后在回调到页面,但是这样的话通过url传递的参数有可能丢失掉,我采用存储cookie的方式来传值 建一个CookieHelper.js文件 function Cookie ...

  7. 标识映射(Identify Map)

    通过在Map中保存每个已加载过的对象,确保每个对象只加载一次. 当要访问对象时,首先检查标识映射,看需要的对象是否已经存在其中. 使用Identify来确保不重复加载相同的数据,不仅有助于保证正确性( ...

  8. FTP协议及工作原理详解

    1. FTP协议 什么是FTP呢?FTP 是 TCP/IP 协议组中的协议之一,是英文File Transfer Protocol的缩写. 该协议是Internet文件传送的基础,它由一系列规格说明文 ...

  9. 数据结构与算法课程作业--1014. Translation

    这道题思想很简单,就是用map将foreign的作为键值,english的值作为对应的映射值,然后通过直接用foreign作为map对象的下标直接查找. 本题比较烦人的一点就是输入数据,我使用了get ...

  10. Archiving

    There are typically four steps of archving: Preprocessing Write Store Delete   Normally Store is inv ...