Open Popup, Click Link, Open In Parent Window, Close Popup?
I need help please. What I want to do from my page is to open a popup for which I use this:
Solution 1:
I think you can use window.opener
window.opener.location.href=x
Solution 2:
To access main opener
window from a pop-up use the window.opener
object. You can access any opener property, or even a function call like that (as long as domains match, as @N Rohler pointed out in the comment to your question), for example to navigate use window.opener.location.href
. Then you close your pop-up with window.close();
like this:
<ahref="JavaScript:void(0);"onclick="openInParent('http://example.com/');">
click me
</a><script>functionopenInParent(url) {
window.opener.location.href = url;
window.close();
}
</script>
Post a Comment for "Open Popup, Click Link, Open In Parent Window, Close Popup?"