英文:
is it possible to close current tab of browser using java/spring boot
问题
我的要求是使用Java/Spring Boot关闭当前选项卡。有没有办法用Java做到这一点。
如果没有。那么我们能不能在Java中使用其他语言来实现这个功能。
英文:
my requirement is to close the current tab using java/Spring boot . is there any way to do this with java.
if not . then can we use other language in java to achieve this functionality.
答案1
得分: 1
window.close()
方法会关闭当前窗口,或者调用该方法的窗口。只能在通过 Window.open()
方法由脚本打开的窗口上调用此方法。
由于 Java 是一种后端语言,不能用于关闭当前窗口。
可以使用以下方式代替:
close();
这等同于:
window.close();
(假设是当前标签页)
英文:
The Window. close() method closes the current window, or the window on which it was called. This method can only be called on windows that were opened by a script using the Window. open() method.
Since Java is a back-end language, it cannot be used to close current windows.
Instead, use:
close();
Which is the equivalent of:
window.close();
(It assumes the current tab)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论