Roload Iframe
来源:互联网 发布:电影票用什么软件 编辑:程序博客网 时间:2024/06/07 04:46
<div class="project"> <iframe id="currentElement" class="myframe" name="myframe" src="http://somesite.com/something/new"></iframe></div>
像上边的一个iframe,要重新加载,分两种情况:
1. 同一个域名
document.getElementById(FrameID).contentDocument.location.reload(true);
或者
iframe.contentDocument.location=iframe.src
IE9下面用这个:
document.getElementById(FrameID).contentWindow.location.reload(true);
- 不同域名
如果是不同域名的话,contentDocument 会被禁止。具体请看下面的链接:
https://en.wikipedia.org/wiki/Same-origin_policy
用下面的方式可以实现:
var iframe = document.getElementById(FrameId);iframe.src = iframe.src;
如果你想从一个iframe里重新加载另一个iframe,很不幸, that is not possible。
http://stackoverflow.com/questions/4249809/reload-an-iframe-with-jquery
0 0
- Roload Iframe
- iframe
- Iframe
- iframe
- iframe
- iframe
- IfRame
- iframe
- iframe
- iframe
- iframe
- iframe
- iframe
- iframe
- iframe
- iframe
- iframe
- Iframe
- python正则替换
- 在本地maven仓库添加包
- 每个程序员都应该收藏的算法复杂度速查表
- 关于大学里的学习以及其他
- Android基础-canvas paint
- Roload Iframe
- C++银行储蓄程序代码
- liunx安装jdk
- Android 摄像头系统调用
- openjdk卸载
- 一段时间只做一件事情
- HashSet 内部实现
- Android开机过程
- uboot.2015.07移植之建立单板(3)