Forum Moderators: open

Message Too Old, No Replies

document.write + onmouseover commands

         

mauimallard

9:11 pm on Jun 11, 2004 (gmt 0)



Ok I'm a little new at java scripting.

Basically i have a script set up to hide (hopefully) an email from bots.

<!-- start JavaScript to hide email address from spambots and display "Site Feedback" for webmaster. -->
<script language="JavaScript" type="text/javascript">
var web = "webmaster";
var url = "example.com";
var subject = "?subject=Site Feedback";
function site_feedback() {
document.write("<A HREF=\"mailto");
document.write(":" + web + "@");
document.write(url + subject + "\">" + "Site Feedback" + "<\/a>");
}
</script>

I want to add a onmouseover window.status command but I can't get it in there without there either being errors or it just adding "onmouseover=" to the subject line.

Basically I just want to add onMouseover="window.status='Site Feedback!'; return true"
onMouseout="window.status=' '; return true">

Any help would be great.

[edited by: Woz at 10:24 am (utc) on June 12, 2004]
[edit reason] examplified [/edit]

createErrorMsg

3:02 pm on Jun 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



maui, this version of your function works (in IE6, anyway). I'm not sure what you tried, but the problem might have been in closing the quote started just before the mailto:. Without closing that quote, it includes the 'onmouseover' part in the href.

function site_feedback() {
document.write("<A HREF='mailto:" + web + "@");
document.write(url + subject + "' onmouseover=\"window.status='Site Feedback!'; return true\" onmouseout=\"window.status=' '; return true\">" + "Site Feedback" + "<\/a>"); }