Recently, I encountered a permission management system. Because the permission management system is different from the original system style, all new windows are opened. The problem arises. After the admin logs out, the permission management window is not closed. After other common users log on, they can still operate on the permission management window.
Simplified problem: when admininjection is disabled, all new windows opened are closed together when main.html is closed. The problem is solved.
Check the Code directly:
<! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">
Note:
<Body onUnload = "closeNews ();"> it is important to add an onUnload Event to the body. That is, when the window is closed, execute the method of closing all subwindows.
Test: In web projects, ie8, ie10, Firefox, chrome, and opera are all correct.
Once the Web container is not put down, there is a problem with ie when it is only a static main.html page, because the window. open () of ie is actuallyOpen a new page, instead of opening a new tag. All window close methods are no longer valid.
Time is limited. I have not spent any time studying it. I also hope that the js technology experts can give me some guidance. Thank you again.