How to listen to the window.open
event.
I have a function in which I export to excel as
window.open('URL','_self');
It is working fine but what I need to achieve is while exporting of data I need to show one loader and after compilation of window.open
,I need to remove that loader. But I am unable to catch that window.open
callback event.
Can anyone please help me on this.
I tried addEventListener
,load and onload
of window events nothing worked.
function windowClose() {
window.location.reload();
alert("fdg");
}
var popup= window.open('URL'_self' );
popup.onload = windowClose;