我是靠谱客的博主 坦率金毛,这篇文章主要介绍iframe 的刷新方式 这样方式更方便,现在分享给大家,希望可以做个参考。

iframe的刷新方式

1. 刷新方式可以使用 javascript 的 document.fr.location.reload()

2. 还有就是修改 document.fr.location.href 也可以实现刷新的功能

例如:

复制代码
代码如下:

<iframe name="fr" width="96%" src="alert_search.do?method=findSys"></iframe>
<script type="text/javascript">
function show_syslog(id){
document.fr.location.href="/alert_search.do?method=findSys&id="+id;
}
</script>
<input type="button" onclick="javascript:show_syslog(1)">

注意:千万不要两种方式同时使用,如果同时使用,将会提交两次。

复制代码
代码如下:

document.fr.location.href = "your.html";
document.fr.location.reload();

最后

以上就是坦率金毛最近收集整理的关于iframe 的刷新方式 这样方式更方便的全部内容,更多相关iframe内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(130)

评论列表共有 0 条评论

立即
投稿
返回
顶部