0

I am creating a child window in Javascript using following code:

var wnd = window.open( url );

How can i determine whether child window is refreshed or not? Is there any event for it?

Thanks in advance.

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
Sanky
  • 377
  • 2
  • 6
  • 14

2 Answers2

2

I don't think there's an event for that but you might be looking for the events unload and beforeunload (the latter only expecting a string to be shown in a popup). These are triggered when: closing a window, navigating to a new page or refreshing the actual page.

So in your case you may write something like:

var wnd = window.open( url );
wnd.onbeforeunload = function() { do something here }

Have a look at this post for more examples.

Community
  • 1
  • 1
omacha
  • 105
  • 9
-2

var wnd = window.open( url ); wnd.location.reload();