iframe点击链接它会在父页面而不是在iframe页面中打开 [英] iframe click link it opens in parent page rather than in iframe page

查看:135
本文介绍了iframe点击链接它会在父页面而不是在iframe页面中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户点击iframe对话框窗口中的URL超链接( http://example.com ),对话窗口关闭并且链接在父页面中打开。

User clicks on URL hyperlink (http://example.com) within a iframe dialog window, dialog window closes and link is open in parent page.

如何在父页面中而不是在iframe页面中打开单击的链接?

how do you open the clicked link in the parent page instead of inside the iframe page?

推荐答案

iFrame 页面上:

<a href="javascript:parent.window.location.href='http://cnn.com/';">Go to CNN</a>

这篇关于iframe点击链接它会在父页面而不是在iframe页面中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆