how to close all the opened windows(except the parent)onclick from a parent window in javascript?
I have a parent window which calls for a function that opens 2 new windows in javascript. When I click a close button, I want to close both the child windows. I tried window.close(windowname); windowName开发者_如何学编程.close(). Both didn't work.
Please help..
Assign the return values of your window.open(...)
calls and call .close()
on them later.
Demo: http://jsfiddle.net/ThiefMaster/NCzvH/1/
精彩评论