使用<a> in iframe (1) to load page into iframe (2)

时间:2015-06-14 18:31:59

标签: html iframe

I am setting up an iframe styled page. I have iframes for each piece of my page (header, menu, sidebar, content, etc).

My menu iframe had links in it;

<ul id="workMenuItems" style="display:none">
    <li><a target="contentframe" href="work/courier.php" id="hrefcourier">Courier</a></li>
    <li><a target="contentframe" href="work/scout.php" id="hrefscout">Scout</a></li>
    <li><a target="contentframe" href="work/hunt.php" id="hrefhunt">Bounty Hunt</a></li>
    <li><a onclick="back()" href="javascript:void(0)" id="back">Back</a></li>
</ul>

When I click on any of these (courier for example) it opens a new tab instead of loading that .php into the contentframe. I checked spelling and everything matches.

Also - I am using Chrome - not sure if that's a known issue off hand.

Thanks!

1 个答案:

答案 0 :(得分:0)

在黑暗中拍摄,我将name元素添加到我的iframe中并且它有效。 ID=""显然在这个问题上还不够。感谢任何看过的人!