app教程网 学习教程 js怎么刷新(js刷新页面的语句)

js怎么刷新(js刷新页面的语句)

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

本文来自网络,不代表本站立场,转载请注明出处:https: