【发布时间】:2014-06-22 06:08:00
【问题描述】:
我有两个 iframe,我需要通过单击按钮(在我的 topframe 中)加载另一个本地页面 (help_content.html)(在我的 bottomframe 中)。 topframe 有一个表单 (help_form.html),带有 3 个按钮(2 个可以工作),而 bottomframe 当前是一个 blank.html,需要在单击按钮时加载 help_screen.html。
来自 help_screen.html 的 HTML
<iframe name="topframe" id="topframe" src="help_form.html"><p>Your browser cannot view iFrames</p></iframe>
<br/>
<iframe name="bottomframe" id="bottomframe" src="blank.html"><p>Your browser cannot view iFrames</p></iframe>
Javascript
function openHelp() {
document.getElementById("bottomframe").src="help_screen.html";
}
来自 help_form.html 上的按钮的 HTML
<input type="button" name="help1" value="Click for help" onclick="openHelp()" />
【问题讨论】:
标签: javascript html iframe