如何在弹出窗口中启用window.status?

发布于 2024-12-19 02:52:10 字数 521 浏览 2 评论 0原文

我正在使用

window.status = "myStatusText" 

它在我的应用程序的普通窗口中工作正常,但是如果我想在普通的老式弹出窗口中使用此功能,它就不起作用。

弹出窗口的状态栏可见。我可以在状态栏中看到超链接的原始 URL,并且我想隐藏它们。

window.status 不会覆盖弹出窗口中的原始文本,这正常吗?

<span id="mySpan" class="mySpanClass">

<a id="myLink" href="javascript:myClickFunction();" onmouseover="window.status='myWindowStatus';" onmouseout="window.status='';" >Link</a>

</span>

我已经删除了 onmouseout 事件,现在在鼠标指向链接后 onmouseover-text 可见!

I'm using

window.status = "myStatusText" 

And it's working fine in a normal window in my application, but if I want to use this function in a normal old-fashioned popup-window, it is not working.

The statusbar of the popup is visible. I can see the original URLs of the hyperlinks in the statusbar and i want to hide them.

Is this normal, that window.status does not override the original text in a popup?

<span id="mySpan" class="mySpanClass">

<a id="myLink" href="javascript:myClickFunction();" onmouseover="window.status='myWindowStatus';" onmouseout="window.status='';" >Link</a>

</span>

I've removed the onmouseout event and now the onmouseover-text is visible, AFTER the mouse was pointing the link!

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

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

发布评论

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

评论(3

梦醒时光 2024-12-26 02:52:10

我意识到我们需要取消内置浏览器对事件的处理。这很简单:

<a href="#" onmouseover="window.status = 'test'; return true;" onmouseout="window.status = ''; return true;">Text</a>

您可能是,但是您是否在 window.open 方法中提供 status=1 ?

例如:

window.open ("http://www.stackoverflow.com","mywindow","status=1");

某些浏览器(例如 IE)仅在站点不受信任时才在弹出窗口中显示状态栏,因此,例如在 Intranet 站点上,除非您专门添加 status=1,否则不会显示状态酒吧。

如果您可以看到状态栏,那么您是否遇到了特定错误,或者根本就不起作用?

您可以通过弹出窗口内的某些脚本设置状态栏的文本吗?

I realised that we need to cancel the inbuilt browser handling of the event. This is simple to do:

<a href="#" onmouseover="window.status = 'test'; return true;" onmouseout="window.status = ''; return true;">Text</a>

You probably are, but are you supplying status=1 in the window.open method?

For example:

window.open ("http://www.stackoverflow.com","mywindow","status=1");

Some browsers, for example IE, only show the status bar in a popup window if the site isn't trusted, so, for example, on an intranet site, unless you specifically add status=1, it wont show the status bar.

If you can see the status bar, are you getting a particular error or is it just not working at all?

Can you set the text of the status bar from some script inside the popup window?

回忆追雨的时光 2024-12-26 02:52:10

这样打开弹出窗口

window.open("you url", "mywindow","status=1,toolbar=1");

Open the popup window this way

window.open ("you url", "mywindow","status=1,toolbar=1");

花开浅夏 2024-12-26 02:52:10

使用 status=yes 打开弹出窗口,它将起作用。 –(查看MDN 上的window.open 文档

Open the popup with status=yes and it will work. – (check window.open documentation on MDN)

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