PDA

View Full Version : JavaScript OnMouseOver problem


bart21
09-06-2001, 01:00 PM
Hello everyone

I use a javascript source-file and I link like this in my html-document:
<SCRIPT LANGUAGE='JavaScript' SRC='..\files\flemail.js'></SCRIPT>

The contents of the file:
<!--
//a1javascripts.com
var naam = "info"
var domein = "flandersonline.net"
var klasse = "Mail"

function status_in()
{
document.status='Mail us';
return true;
}

function status_out()
{
document.status='out';
return true;
}

document.write("©<A CLASS=" + klasse + " HREF='MAILTO:" + naam + "@" + domein + "'")
document.write(" OnMouseOver=status_in() OnMouseOut=status_out()>")
document.write("FlandersOnline Team")
document.write("</A>")
//-->

But when I try this script, and I put my mouse on the link, it returns to me:"mailto:info@flandersonline.net" and not "mail us" in the statusbar. But when I go out the link, I see "out"... I really don't understand. Can please someone help me?

_mrkite
09-06-2001, 04:30 PM
status is a window. property :)

scoutt
09-07-2001, 02:35 AM
you can try to put a semi-colon after teh first mouseover

document.write(" OnMouseOver=status_in(); OnMouseOut=status_out()>")

bart21
09-07-2001, 05:49 AM
ok, I changed my faults in your suggestions (thx btw!!!), but it still doesn't helped. In my statusbar, I always see the link, and when I go out the link, I see "out" appearing... I'll give you some urls, so hopefully you'll see what I did wrong...
http://www.flandersonline.net/files/test.html this is the url with sourcelink to the javascript-file
http://www.flandersonline.net/files/test2.html this is the url with the javascript-file inserted (with the document.write stuff)
http://www.flandersonline.net/files/test3.html This is the url without javascript, only with the functions inserted as javascript.

Hopefully someone can help me out. I appreciate everyone's suggestion... thx!!!

scoutt
09-07-2001, 01:20 PM
I get a page not found on all of them.

you could try it this way

<script language="JavaScript">
<!--

function MM_displayStatusMsg(msgStr) { //v1.0
status=msgStr;
document.MM_returnValue = true;
}
-->
</script>


<a href="page.html" onMouseOver="MM_displayStatusMsg('your text here!');return document.MM_returnValue">

bart21
09-08-2001, 10:56 AM
thx! you are really a superhero :D :D :D

scoutt
09-09-2001, 03:58 AM
:)