
Signature
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
> Christopher Nelson wrote on 28 okt 2005 in comp.lang.javascript:
>
[quoted text clipped - 3 lines]
>
> Please first try IE.
It works in IE. In Opera, the status bar updates as desired but the
tooltip shows the Title and the Address. In Firefox, as in Mozilla,
the address is shown in the status bar and I don't seem to be able to
change that.
> > > Did you copy/paste my code in an empty html-page?
> >
> > No. I edited it into my CGI.
>
> Is that the way to conclude "it does not work"?
It didn't work for me in my CGI in the broswer I was using.
> Please try the above first before expanding a javascript advice into your
> own programme.
>
> Does your cgi execute javascript, btw?
My CGI has a ton of JavaScript in it.
> ...
I don't know that I'll do better than what I have. I'd really like to
fix the status bar in Mozilla and Firefox if I could but I don't know
what the problem is.
Evertjan. - 28 Oct 2005 15:49 GMT
Christopher Nelson wrote on 28 okt 2005 in comp.lang.javascript:
> I don't know that I'll do better than what I have. I'd really like to
> fix the status bar in Mozilla and Firefox if I could but I don't know
> what the problem is.
I'm sorry, I am not an expert there.

Signature
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
VK - 28 Oct 2005 16:44 GMT
> Status bar shows anchor href, not text I set in onmouseover
OK - maybe making it as a puzzle will finally attract you to *read* the
suggested FAQ
Read it *through* again and try to find the condition missing in your
script. Theanswer is given below the FAQ's link (ROT 13 encoded).
FAQ 4.35
<http://www.jibbering.com/faq/#FAQ4_35>
<ANSWER: ROT 13>
lbh fubhyq erghea gehr sebz gur rirag
</ANSWER: ROT 13>
Christopher Nelson - 28 Oct 2005 18:18 GMT
> > Status bar shows anchor href, not text I set in onmouseover
>
[quoted text clipped - 10 lines]
> lbh fubhyq erghea gehr sebz gur rirag
> </ANSWER: ROT 13>
Yes, that's one of the changes I made. Having reviewed the FAQ, I
1) used setTimeout to delay setting the status, and
2) returned true from the event handler.
My code now looks like:
function setStatus(text) {
var a ='window.status=\''+text+'\'';
setTimeout(a,15);
return true;
}
function clearStatus() {
window.status=''
return true;
}
and the HTML looks like:
<li><a href='sysconf.cgi' class='menu' target='main'
title='Configure stuff'
onmouseout='clearStatus()'
onmouseover='setStatus("Configure stuff")'>Settings</a></li>
This seems to be fine in IE and Opera but now with Firefox or Mozilla
(where the href shows up, not the desired text).
Thomas 'PointedEars' Lahn - 28 Oct 2005 21:44 GMT
> My code now looks like:
>
> function setStatus(text) {
> var a ='window.status=\''+text+'\'';
> setTimeout(a,15);
Timeouts/intervalls less than 25 *milli*seconds are seldom reliable, and
setTimeout("window.status = '" + text + "';", 25);
will suffice.
> [...]
> and the HTML looks like:
>
> <li><a href='sysconf.cgi' class='menu' target='main'
Think about if the `target' attribute is really necessary. If it is for
frames, think about replacing frames by block elements positioned with CSS.
> title='Configure stuff'
> onmouseout='clearStatus()'
> onmouseover='setStatus("Configure stuff")'>Settings</a></li>
>
> This seems to be fine in IE and Opera but now with Firefox or Mozilla
> (where the href shows up, not the desired text).
You have probably set the preference that disallows scripts to manipulate
the content of the status bar (in Firefox: Edit/Tools, Preferences, Web
Features, Enable JavaScript, Advanced, [_] Change status bar text). That
said, you should almost never mess with the status bar, definitely not
here.
PointedEars
dx27s - 28 Oct 2005 19:26 GMT
> I don't know that I'll do better than what I have. I'd really like to
> fix the status bar in Mozilla and Firefox if I could but I don't know
> what the problem is.
The default settings in Firefox prevent you from changing the status bar
text. Go to Preferences -> Web Features -> Enable Javascript ->
Advanced... and make sure "Change status bar text" is checked.
Christopher Nelson - 28 Oct 2005 19:42 GMT
> > I don't know that I'll do better than what I have. I'd really like to
> > fix the status bar in Mozilla and Firefox if I could but I don't know
[quoted text clipped - 3 lines]
> text. Go to Preferences -> Web Features -> Enable Javascript ->
> Advanced... and make sure "Change status bar text" is checked.
Thanks but even with that enabled, the status bar still shows the href,
not my text. I'm using Firefox v1.0.1, if that matters. <shrug>
Lee - 28 Oct 2005 20:35 GMT
Christopher Nelson said:
>> > I don't know that I'll do better than what I have. I'd really like to
>> > fix the status bar in Mozilla and Firefox if I could but I don't know
[quoted text clipped - 6 lines]
>Thanks but even with that enabled, the status bar still shows the href,
>not my text. I'm using Firefox v1.0.1, if that matters. <shrug>
With changing the status bar enabled, the following works for
me in Firefox 1.0.7:
<html>
<body>
<script type="text/javascript">
function handleOver(text) {
window.status=text;
}
</script>
<a href="#" onmouseover="handleOver('my message');return true">Demo</a>
</body>
</html>
Thomas 'PointedEars' Lahn - 28 Oct 2005 21:50 GMT
>> > I don't know that I'll do better than what I have. I'd really like to
>> > fix the status bar in Mozilla and Firefox if I could but I don't know
[quoted text clipped - 6 lines]
> Thanks but even with that enabled, the status bar still shows the href,
> not my text. I'm using Firefox v1.0.1, if that matters. <shrug>
The following works for me in
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922
Firefox/1.0.7 (Debian package 1.0.7-1) Mnenhy/0.7.2.0
(and other UAs) if the above pref is enabled:
function setStatus(o, bHideURI)
{
var s = o.title;
if (!bHideURI && typeof o.href != "undefined")
{
s += " (" + o.href + ")";
}
window.status = s;
return true;
}
function resetStatus()
{
window.status = window.defaultStatus;
return true;
}
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- missing system identifier triggers Quirks Mode -->
[...]
<a href="main.en.php" title="Display Language: English"
onmouseover="return setStatus(this)" onmouseout="resetStatus()"
>English</a>
HTH
PointedEars
Christopher Nelson - 31 Oct 2005 15:10 GMT
> ...
> The following works for me in
[quoted text clipped - 24 lines]
> onmouseover="return setStatus(this)" onmouseout="resetStatus()"
> >English</a>
Cool. I like using o.title for the status bar. Thanks.