[英]javascript - open frame in new window
I have a page which is displayed in a frame as part of another site.我有一个页面作为另一个站点的一部分显示在框架中。 I want to add a link to this page which will allow the user to open the page in a new window ie out of the frame.
我想添加一个指向此页面的链接,该链接将允许用户在新的 window 中打开页面,即超出框架。 how do I do this?
我该怎么做呢?
I have tried using我试过使用
<a href="javascript:window.location.href" target="_blank">Remove frame</a>
but this did not work and only opened a new window with the address javascript:window.location.href
但这不起作用,只打开了一个新的 window,地址
javascript:window.location.href
<input onclick="javascrpt:window.open(window.location.href);" type="button" value="your value here" />
Try:尝试:
<a href="javascript:window.location='whereiwanttogo.html';" target="_blank">
You can use this, it worked for me:你可以使用它,它对我有用:
<a href="javascript:window.open(window.location.href);return true;" target="_blank">Printable version</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.