vishnu vishnu - 7 months ago 10
HTML Question

How do we know how many popups are open?

In my application, window opened pop1, pop1 opened pop2 and pop2 opened pop3. I am in pop3. How i know how many windows/popups opened before pop3 in jquery or javascript

Answer

I figured out. It might helpful for any one who looking for the answer. In below code count will give the answer to find the no of windows to open.

popup = this;count=0;
if(window.top != popup.self)
{
 count=count+1;
 popup = popup.parent;
}