I would like to close the current popup, open a new window (tab) and redirect to a specific link. This works extremly easy with my <a>
links. I simply add "target="_blank"" and it works just fine (it doesnt close the pop up actually, but minimizes it and thats fine too).
Since I am using some buttons with a onclick function, I want to implent the "target="_blank" in the button somehow... The button looks like this at the moment:
<input type="button" onclick="parent.window.opener.location='http://google.com'; window.close();">
This works, but the problem is that it redirects in the parent window and doesnt open a new window...
Any1 has an idea how to get the feature of "target="_blank" so that a click on button will open a new window and than redirect instead of redirecting the parent window?
jQuery code:
HTML code:
It works OK in Chrome and IE. In Firefox, you must open this code with
window.open
.Why not just use this in your onclick:
It works un IExplorer, Firefox, Chrome, Opera and Safari
Try this: