<br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode112'));"><u>复制代码</u></span></div>代码如下:</div> <div class="msgborder" id="phpcode112"> <br><iframe src="1.htm" name="ifrmname" id="ifrmid"></iframe> <br> </div> <br>方案一: <br>用iframe的name属性定位 <br><br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode113'));"><u>复制代码</u></span></div>代码如下:</div> <div class="msgborder" id="phpcode113"> <br><input type="button" name="Button" value="Button" onclick="document.frames('ifrmname').location.reload()">或 <br><input type="button" name="Button" value="Button" onclick="document.all.ifrmname.document.location.reload()"> <br> </div> <br>方案二: <br>用iframe的id属性定位 <br><br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode114'));"><u>复制代码</u></span></div>代码如下:</div> <div class="msgborder" id="phpcode114"> <br><input type="button" name="Button" value="Button" onclick="ifrmid.window.location.reload()"> <br> </div> <br>终极方案: <br>当iframe的src为其它网站地址(跨域操作时) <br><br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode115'));"><u>复制代码</u></span></div>代码如下:</div> <div class="msgborder" id="phpcode115"> <br><input type="button" name="Button" value="Button" onclick="window.open(document.all.ifrmname.src,'ifrmname','')"> <br> </div>