我可以更新一个iframe吗?
问题描述:
我想更新另一个iframe。我有一个iframe中的链接,它应该更新其他iframe的内容。 checkresult.html中有链接,它应该更新statusmessage.html。我可以更新一个iframe吗?
<table width="100%">
<tr>
<td width="10%">
<iframe id="test" src ="checkresult.html" height="1000px" width="100%" frameborder="1">
</iframe >
</td>
<td align="left" width="80%">
<iframe id="msgstatus" name = "test" src ="StatusMessage.html" align="left" width="100%" height="1000px" frameborder="1" >
</iframe></td>
</tr>
</table>
答
如果你想在一个框架中的链接另一个打开,你需要参考其他的在链接的target
属性name
属性。因此,在这种情况下,checkresult.html
一个环节都需要有test
目标在msgstatus
框架中打开:
<a href="something.html" target="test">Link text</a>