var loop = setInterval(function () { if (winObj.closed) { clearInterval(loop); parent.location.reload(); } }, 1000);