...

View Full Version : can i use document.write & onmouseover="status=''" together?



canadianjameson
11-03-2004, 02:13 AM
hey. quick question

i use this to display e-mail addresses on my page so harvesters cant ravage me in my sleep:



<script language="JavaScript">
<!--
var name = "info";
var domain = "enviromark.ca";
document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
document.write(name + '@' + domain + '</a>');
// -->
</script>


i want to modify this to display in the status bar: "Click here to send an e-mail to info@enviromarrrrrrrk.ca (minus six r's (unless you're a pirate :)))

can i somehow modify the script to do the following?



<script language="JavaScript">
<!--
var name = "info";
var domain = "enviromark.ca";
document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
document.write(name + '@' + domain + '</a>');
onMouseOver="status='Click here to send an e-mail to document.write(name + '@' + domain)' ; return true"
onMouseOut="status=''"
// -->
</script>


that code doesnt work for me... how can i get it to do that?

i also tried this:



<script language="JavaScript">
<!--
var name = "info";
var domain = "enviromark.ca";
document.write('<a href=\"mailto:' + name + '@' + domain + '\" onMouseOver="status='Click here to send an e-mail to document.write(name + '@' + domain)' ; return true" onMouseOut="status=''">');
document.write(name + '@' + domain + '</a>');
// -->
</script>


but to no avail

Kor
11-03-2004, 09:10 AM
you should:

use window.status
use return true to get rid of the default window status


<script language="JavaScript" type="text/JavaScript">
<!--
var name = "info";
var domain = "enviromark.ca";
document.write('<a href="mailto:' + name + '@' + domain + '" onmouseover="window.status=\'Click here to send an e-mail to '+ name + '@' + domain+'\';return true" onmouseout="window.status=\'\'">');
document.write(name + '@' + domain + '</a>');
// -->
</script>

canadianjameson
11-03-2004, 03:37 PM
thanks kor, works like a charm



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum