John
John

Reputation: 21927

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

Upvotes: 0

Views: 4709

Answers (3)

<input onclick="javascrpt:window.open(window.location.href);" type="button" value="your value here" />

Upvotes: 1

mar9000
mar9000

Reputation: 21

You can use this, it worked for me:

<a href="javascript:window.open(window.location.href);return true;" target="_blank">Printable version</a>

Upvotes: 0

user2004352
user2004352

Reputation: 1

Try :

<a href="javascript:window.location='whereiwanttogo.html';" target="_blank">

Upvotes: 0

Related Questions