JavaScript window.status [英] JavaScript window.status

查看:189
本文介绍了JavaScript window.status的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次尝试JavaScript:

hi this is my first attempt at JavaScript:

以下函数用于显示窗口状态栏消息。它在本地机器上工作正常,但是当我上传服务器时,消息根本不显示。

the following function is used to display window status bar messages. it works fine on the local machine but when i upload it too the server the messages are not displayed at all.

我做错了什么?请帮助。

what am i doing wrong? please help.

[网站] [已删除链接]

[website][link removed]

function displayMsg(msg){

window.status = msg;

}

当您将鼠标悬停在图像上时应该会发生什么显示一条消息以点击它然后更新图像。

what should happen is when you hover over the image it should display a message to click it and the image is then updated.

我看到这个但是如果这不再可能那么为什么它在本地工作?

i saw this but if this is no longer possible then why does it work locally?

编辑:谢谢你的支持回答。我想知道一旦图像结束事件发生后是否可以显示工具提示?谢谢,

thank you for your answer. i am wondering if it is possible to display a tooltip once the image over event happens? thanks,

编辑:我添加了一个Title属性,它似乎显示了一个工具提示。你所看到的将是最受欢迎的输入。谢谢。

i have added a Title attribute and it seems to display a tooltip. what you are seeing would be most welcome input. thanks.

编辑:Google Chrome工作正常。 Safari不运行javascript。 im on win7。

Google Chrome works fine. Safari does not run javascript. im on win7.

推荐答案

window.status 已被禁用(如果不是全部)浏览器出于安全原因(可以通过这种方式为链接伪造一个不同的位置)。

window.status has been disabled in most (if not all) browsers for security reasons (it was possible to fake a different location for links that way).

参见eg在window.status上 MDC页面

See e.g. the MDC page on window.status:


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

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.

它也在IE 7中删除。

it was also removed in IE 7.

至于为什么它在本地工作,我不能说。也许那里的安全限制更加宽松,虽然这很奇怪!

As to why it works locally, I can't say. Maybe security restrictions are more relaxed there, although it's strange!

这篇关于JavaScript window.status的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆