当一个窗口不是通过window.open或者window.showModalDialog打开的时候,调用JS的window.close() 谷歌浏览器会提示如下警告,并拒绝执行 Scripts may close only the windows that were opened by it. 解决方法:(此方法无效) function closeWindow(){ var browserName=navigator.appName; alert(browserName); if (browse