I try to open pop up in the same window, but it forwards me to another. Also, I try to refresh window after pop up closes, but I don’t find easy solution. I think the best is not to put # to the URL. That is my function:
<li value="Open window" >
<a href="javascript: window.open('upd.php?m=<?php echo $oldpar?>','','width=520,height=400')">
<u>EDIT</u>
</a>
</li>
I manage open the window, however main page also goes to javascript: window.open('upd.php?m=2','','width=520,height=400'). I tried to put:
<script type="text/javascript">
<!--
function refreshParent()
{
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow)
{
window.opener.progressWindow.close()
}
window.close();
}
//-->
</script>
It would be great to close pop up automatically after user select variables and press button. Immediately after the parent(main) URL would refresh.. Any help? 🙂
P.s. any ideas how to auto refresh pop up? I saw all browsers have different way of doing that.. Common one?
Use “_self” as the window title (second parameter to
window.open()) to open the pop up in the same window.Use
window.location.reload();to reload the current window.Use
opener.location.reload();to reload the window that opened the popup before callingwindow.close();