Bajrang
Bajrang

Reputation: 8629

new window or tab is opened now, How can i check it

How can i check that the new window or tab is opened or exited now of same site ,so i can store/destroy some values in session variable accordingly. If its possible in php then best then better. I am using mostly IE 6.0 and above.

Thanks a lot.

Upvotes: 0

Views: 147

Answers (1)

Ibu
Ibu

Reputation: 43810

Obviously i haven't tried this in IE but it should be a standard

when you open a window in your script, you can still control it.

var win = window.open("http://example.com");

if (win) {
  // the window is open.

  // you can close it with the close method
  win.close();
}

Upvotes: 2

Related Questions