Search code examples
phpparent-childparentreload

Reload parent page from PHP page loaded in DIV tag


Hi I have a PHP page loading in a DIV tag from a javascript function. I also have a button on this PHP page that sends information to another PHP page. I was using header to go back to the page I was on (still in the div tag) but I was wondering if there is a way to reload the original parent page. The pages are all saved in separate files so I was unsure how to do this. I have tried using Javascript such as top, window, and opener for location.reload() e.g. top.location.reload() window.location.reload() and saving the function on each page as function myFunctio(){ location.reload(); } and then calling it on each page again using top, window, and opener but nothing has worked. If I use a header it will only load the page in the DIV.


Solution

  • You can use them in sequence to get the result you're looking for give something like window.opener.location.reload(false); a try