Santosh
Santosh

Reputation: 17923

Close the parents's parent window

Here is scenario

window1 -Opens-> window2 -Opens-> window3

What I need the an operation where in windows closes in following order

window3 window2 window1

The operation should be initialed from the window3.

Upvotes: 0

Views: 274

Answers (1)

Sudesh
Sudesh

Reputation: 1169

create a javascript function as below

function windowClose()
{
    parent.windowClose(); //Parent is parent window, need to check whether current has parent
    window.close();
}

Place this function in all windows

Upvotes: 1

Related Questions