设为首页 加入收藏

TOP

JS实现刷新iframe的方法
2014-10-30 19:30:15 】 浏览:309
Tags:实现 刷新 iframe 方法

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


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


  


  onclick="document.frames('ifrmname').location.reload()">


  或


  


  onclick="document.all.ifrmname.document.location.reload()">


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


  


  onclick="ifrmid.window.location.reload()">


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


  


  onclick="window.open(document.all.ifrmname.src,'ifrmname','')">


  怎样才刷新showModalDialog和showModelessDialog里的内容?


  在showModalDialog和showModelessDialog里是不能按F5刷新的,又不能弹出菜单。这个只能依靠java script了,以下是相关代码:


  


  将filename.htm替换成网页的名字然后将它放到你打开的网页里,按F5就可以刷新了,注意,这个要配合使用,不然你按下F5会弹出新窗口的。


  var reload = document.getElementById("reload");


  reload.href = new_url; //url


  reload.click();


  编辑推荐:


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Java打印程序设计全攻略 下一篇使用JAVA数字证书做数字签名认证

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目