timeout - Close pop up and refresh parent page javascript -


i want close pop , refresh parent after few seconds delay make sure data received. have following

function closeandrefresh(){       settimeout(function()  {      window.open('/{!currsubid}','_top'); window.location = window.location.href; return true; },5000)} 

this code refreshes parent inside popup, pop not close, rather parent shows refreshed - in pop up

so move pop outside of timeout, give name, call close, , reload.

function closeandrefresh(){         var winpop = window.open('/{!currsubid}','_top');  //load pop give name     window.settimeout(function(){         winpop.close();  //close pop         window.location.reload(true);  //refresh current page     },5000); } 

you use ajax call server , not have deal pop , wondering if pop blocker block or not knowing if call completetd. when call comes call, can reload page.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -