This line is from my JSP file.
I opened this page by setting a target attribute in the
<a> tag like
target ="_TOP", but the code below is not working. How can I close this window?
<a href="myurl" onclick="window.open('myurl'); return false;">mylink</a>
<a href="page.jsp" target="_blank"
onclick="var w=window.open(this.href,this.target); return w?false:true">pop a new window</a>
<a href="page.jsp" target="mywin" onclick="var w=window.open(this.href,this.target); return w?false:true">pop a new window</a>
the later you can get the handle:
var w = window.open('','mywin'); if (!w.closed) w.close()
©2020 All rights reserved.