开发者

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 i.e. out of the frame. 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


<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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜