使用下面的JS代码,即可关闭弹出窗口,如果只用window.close(),可能主页面关不了
<a href="javascript:window.opener=null;window.open('','_self');window.close();">关闭</a>