如何在 Firefox 和 Chrome 中查看/设置瞬时消息状态栏?

发布于 2024-08-22 08:03:45 字数 1376 浏览 1 评论 0原文

我向 HTML 文档添加了一条新的临时状态栏消息(特别是表中列出的 5 个链接,请参阅下面的代码),它在 IE 中运行良好,但当我在 Firefox 或 Chrome 中查看该文档时,该消息没有出现。我看到的只是 URL 链接。有人可以告诉我如何让瞬时状态栏消息在 Firefox 和 Chrome 中显示吗?

这是我的代码:

<table>
<tr><td colspan="5"><img src="logo.gif" alt="The Civil War Journal" /></td></tr>
<tr><td>
   <a href="cwj.htm" class="Links" 
      onmouseover = "window.status='Go to the Home Page'; return true"
      onmouseout = "window.status=''; return true">Home Page</a>
</td>
<td>
   <a href="#" class="Links"
      onmouseover = "window.status='View Current Events'; return true"
      onmouseout = "window.status=''; return true">News</a>
</td>
<td>
   <a href="#" class="Links"
      onmouseover = "window.status='Go to Feature Articles'; return true"
      onmouseout = "window.status=''; return true">Features</a>
</td>
<td>
   <a href="#" class="Links"
      onmouseover = "window.status='Go to the Civil War Form'; return true"
      onmouseout ="window.status=''; return true">Forum</a>
</td>
<td>
   <a href="form.htm" class="Links"
      onmouseover = "window.status='Subscribe Today!'; return true"
      onmouseout = "window.status=''; return true">Subscriptions</a>
</td></tr></table>

I added a new transient status bar message to my HTML document (specifically the 5 links listed in the table, see code below) and it worked fine in IE but when I viewed the document in Firefox or Chrome the message did not appear. All that I saw was the URL link. Can someone show me how I can get the transient status bar message to show in both Firefox and Chrome?

Here is my code:

<table>
<tr><td colspan="5"><img src="logo.gif" alt="The Civil War Journal" /></td></tr>
<tr><td>
   <a href="cwj.htm" class="Links" 
      onmouseover = "window.status='Go to the Home Page'; return true"
      onmouseout = "window.status=''; return true">Home Page</a>
</td>
<td>
   <a href="#" class="Links"
      onmouseover = "window.status='View Current Events'; return true"
      onmouseout = "window.status=''; return true">News</a>
</td>
<td>
   <a href="#" class="Links"
      onmouseover = "window.status='Go to Feature Articles'; return true"
      onmouseout = "window.status=''; return true">Features</a>
</td>
<td>
   <a href="#" class="Links"
      onmouseover = "window.status='Go to the Civil War Form'; return true"
      onmouseout ="window.status=''; return true">Forum</a>
</td>
<td>
   <a href="form.htm" class="Links"
      onmouseover = "window.status='Subscribe Today!'; return true"
      onmouseout = "window.status=''; return true">Subscriptions</a>
</td></tr></table>

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

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

发布评论

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

评论(1

紫瑟鸿黎 2024-08-29 08:03:45

抱歉,如果没有 无法完成用户更改浏览器设置:

此属性在 Firefox 和其他一些浏览器的默认配置中不起作用:设置 window.status 对状态栏中显示的文本没有影响。要允许脚本更改状态栏文本,用户必须在 about:config 屏幕中将 dom.disable_window_status_change 首选项设置为 false。

这是针对 Firefox 的,我想在 Chrome 中也是一样的。更改状态栏被认为是一种安全风险,并且将越来越不受支持。考虑使用 title 属性来对链接进行详细说明:

<a href="cwj.htm" class="Link" title="Go to the Home Page">

当用户将鼠标悬停在链接上时,它将出现在工具提示中。

Sorry, can't be done without the user changing a browser setting:

This property does not work in default configuration of Firefox and some other browsers: setting window.status has no effect on the text displayed in the status bar. To allow scripts change the the status bar text, the user must set the dom.disable_window_status_change preference to false in the about:config screen.

This is for Firefox, I assume it's the same in Chrome. Changing the status bar is considered a risk security-wise, and will be less and less supported. Consider using a title attribute for a verbose explanation of the link:

<a href="cwj.htm" class="Link" title="Go to the Home Page">

it will appear in a tooltip when the user hovers with the mouse over the link.

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