问题
It was once possible to change the message a browser shows in the status bar at the bottom of the window. This functionality has been disabled in newer browser versions due to abuse.
<script type="text/javascript">
window.status = 'hello world';
</script>
Is there still any way to achieve this (consider jQuery available)? I think I still see pages around that change the status message, but they might use Flash or Java to change the window status.
回答1:
There are two things you can do without Flash or Java:
Fake it: display a
divthat looks like a status bar.position: fixed; bottom: 0; left: 0; border: 1px solid silver; background: #aaaaaa;Choose URLs so that you show desired information to the user when they hover over links.
But please don't.
回答2:
Using the browsers statusbar to display page info is in most cases a very bad idea, the browsers has not disabled it without reason.
- Nobody looks down there to find such info.
- People expect it to show browser information. When hovering links for example i want to know if i leave the site, if it's a mailto:-link, if it's a pdf etc.
Instead use somthing like the orange(yellow?) thing stackoverflow have at the top of the page. "Are you new to stackoverflow...", "New posts has been added..." etc etc.
回答3:
Have a look at the pages still changing this info. If it is being done by javascript you should be able to see the source.
来源:https://stackoverflow.com/questions/536691/javascript-change-browser-window-status-message