在Chrome49.0.2623.87m和Firefox45.0.1中,当在href中包含两个目标时,第二个img标签不会尊重“img”选项,并在同一窗口中打开链接,这是一个iframe。
<a target="_parent" href="oneclickcheckout.asp">
<img border="0" src="images/cart.png" height="35" alt=".." title="..">
<img src="images/checkout.png" height="32" alt="" title="" border="0">
</a>当我分离href时,它也会这样做,这真的很奇怪:
<a target="_parent" href="oneclickcheckout.asp">
<img border="0" src="images/cart.png" height="35" alt=".." title=".."></a>
<a target="_parent" href="oneclickcheckout.asp">
<img src="images/checkout.png" height="32" alt="" title="" border="0"></a>发布于 2016-04-01 22:39:44
我假设您有一个包含如下框架的页面:
<iframe src="test.php" name="myframe" id="myframe"></iframe>如果你想让你的链接只在你的框架中工作,那么你可以这样做:
<a target="myframe" href="oneclickcheckout.asp">
<img border="0" src="https://www.google.com/images/nav_logo242.png" height="35" alt=".." title="..">
<img src="https://www.google.com/images/nav_logo242.png" height="32" alt="" title="" border="0">
</a>现在,如果你点击图片,他们就会在你的页面中打开链接。请注意,我所做的更改是这样的:框架具有名称和id。我的链接在加载到框架中的html页面中的目标是框架的id。
https://stackoverflow.com/questions/36358933
复制相似问题