简体   繁体   English

关闭弹出窗口后如何重新加载现有页面

[英]How to reload the already existing page after closing popup window

i am using javascript, php, mysql. 我正在使用javascript,php,mysql。
I have a button on 'index.php'. 我在“ index.php”上有一个按钮。 A new window will open on click of this button(not new tab) 单击此按钮将打开一个新窗口(不是新标签)
The code is like this. 代码是这样的。

function getUtilities(sid,sfname,smobnum,subdid)
{   
   var url='';
   url="update.php?sid="+sid+"&sfname="+sfname+"&smobnum="+smobnum+"&subdid="+subdid;
   popupNote(url);  
}


function popup(url)
{
 var width  = 500;
 var height = 200;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}

So i will have my popup opened. 所以我将打开我的弹出窗口。 i am performing some update operation.. and i'l close it. 我正在执行一些更新操作。并且我将其关闭。 After closing the popup i want to refresh my 'index.php'. 关闭弹出窗口后,我想刷新我的“ index.php”。 But i am unable to do that. 但是我做不到。

You will want to run the following JS on the popup window when you are ready to reload the parent page and close the popup. 准备重新加载父页面并关闭弹出窗口时,您将需要在弹出窗口中运行以下JS。

<script>
  window.opener.location.reload();
  window.close();
</script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM