Mozilla Firefox 的 window.open 上未显示菜单栏

发布于 2024-07-25 20:33:14 字数 444 浏览 4 评论 0 原文

当我在 Mozilla Firefox 中运行下面的 JavaScript 代码时,菜单栏不显示:

                window.open(location.pathname + "?print=print",
                    "print-window",
                    "toolbar=yes,location=no,scrollbars=yes,menubar=yes");

这里出了什么问题?

请注意,我正在打开同一个文件(在另一个窗口中),我只是向其中添加一个参数值。 我不知道这是否重要。

奇怪的是,如果我

                    window.print();

在新窗口上调用:,菜单栏就会显示。

When I run the JavaScript code below in Mozilla Firefox, the menu bar does not show:

                window.open(location.pathname + "?print=print",
                    "print-window",
                    "toolbar=yes,location=no,scrollbars=yes,menubar=yes");

What is going wrong here?

Note that I'm opening the same file (in another window), I'm just adding a parameter value to it. I don't know whether this matters.

Strangely enough, if I call:

                    window.print();

on the new window, the menu bar does show.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哆兒滾 2024-08-01 20:33:14

您是否尝试过 menubar=1 ...或者可能 menubar=true ?

Have you tried menubar=1 ... or possibly menubar=true?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文