Forum Moderators: open
1.) The email: i.e. a link that opens a new email in your mail client, something that produces the same effect as: <a href="mailto:me@mydomain.com">email me</a>.
and
2.) Open a web page: A thankyou php page with some code that increments the count of emails from the website.
(have got the php code and taken precautions against spambots).
I have been trying to do this for months. Today I figured out a way of doing it. However so many people told me it couldn't be done that I would like to ask if my code will create a problem. It works on my PC with IE-6.
My code (Got this code via DreamWeaver, I'm not a javascript expert!):
<head>
<script language="JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>
<body>
<a href="#" onClick="MM_goToURL('parent','mailto:fred@domain.com');MM_goToURL('parent','thankyou.php');return document.MM_returnValue">email
link</a>
</body>
Will this work in general browsers?
Can anyone think of a simpler way of doing it?
<a href="mailto:me@mydomain.com" onClick="javascript:window.location.href='www.something.com'">email me</a> There's a space after the com"
- don't know about the deprecated part, i do not usually put mail addresses on webpages.
/claus
<edit> i see from your DW code that you might have to use "parent" in stead of "window" - possibly because you use frames. If not it's just DW that suck :) </edit>
I would provide an on-screen script-driven email-form with submit button, and a completely separate email link for those who want to send you email via their email program. However, opening two windows is not a good idea.
You'll need to hide the email address from spiders too. See [webmasterworld.com...] for more.
and a completely separate email link for those who want to send you email via their email program.That is what I want to track. I can easily track when a visitor completes a form but I want to track how many click the ordinary email link.
You'll need to hide the email address from spiders too.I did say: "...I have taken precautions against spambots". To be specific, I use: [hiveware.com...]
THANKYOU CLAUS!
This seems to work much better - and doesn't have all that extra DW code :)
<a href="mailto:me@mydomain.com" onClick="javascript:window.location.href='thankyou.php'">email me</a>
I have typically always favored web based forms. Also lets you get out numerous environment variables you can put in the email too.