is it possible to close current tab of browser using java/spring boot

huangapple go评论60阅读模式
英文:

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)

huangapple
  • 本文由 发表于 2020年10月3日 22:59:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/64185598.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定