Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何禁用窗口中的 (X) 按钮。
我尝试在 window.open 中使用一些属性,例如 titlebar=no/0 ,但它不能正常工作。任何人都可以帮我解决这个问题。
提前致谢
请参阅此页面和此页面。您可以处理该onunload事件,但您无法阻止窗口关闭;如果他们想“离开页面”,你可以做的最好的提示用户。
onunload
你不能禁用关闭按钮,因为 wj32 说你能做的最好的事情就是在他们关闭窗口时显示警告。