【发布时间】:2026-02-10 16:05:01
【问题描述】:
我需要创建一个打开页面的链接,但在该页面的 iframe 中设置新目标,这可能吗?
例如。
'Link1' 必须链接到 'index.html' 这个页面上已经有一个 iframe,但是当 'index.html' 加载时,我需要在 iframe 中加载 'hamsters.html'。
还会有一个
'Link2' 和 'Link3' 这些也将链接到 'index.html' 但是 'link2' 将在 iframe 中加载页面 'rabbits.html',而 'link3' 将加载页面 'gerbils.html'在 iframe 内。 iframe 仍然位于“index.html”中。
我希望这很清楚,我的原始链接代码,示例中的'link1'位于下面。
谢谢
<td onclick="window.location = 'index.html';" style='cursor: hand; cursor: pointer;' background="images/static.gif" id="td1" width="25%" bgcolor="#FFFFFF">
【问题讨论】:
标签: javascript jquery html iframe