简体   繁体   中英

How to reload the already existing page after closing popup window

i am using javascript, php, mysql.
I have a button on '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'. 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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