要知道w1,w2的關系.
如w2是w1打開的
var ww=window.open("w2")
ww.close()
如w1是w2打開的
w2.opener.close()