moon wrote:
I missed a few things in my first reply, I'll try to correct them in
this message:
First of all, using 'mailto:' is not recommended:
http://www.allmyfaqs.com/faq.pl?Email_form_data http://www.isolani.co.uk/articles/mailto.html
If you still want to use mailto...
u = window.location;
m = "I thought this might interest you...";
These variables should be local - if they are only used in the function
mailThisUrl - they should be declared using var in the function. Use
local variables whenever possible. Here's a little reading about
declaring variables, and global/local variable scope.
http://www.mredkj.com/tutorials/refe..._intro_ex.html
http://www.eecs.tufts.edu/~stauber/m...js_basics.php3
"mailto:"+document.eMailer.address.value+"?subject ="+m+"&body="+document.tit le+" "+u;
I broke the string into pieces and placed it in a local variable so it
is easier to see what's going on. Change the last line to include the
additional message body text you want instead of "test string'.
var msgstring = 'mailto:' + document.eMailer.address.value;
msgstring += '?subject=' + subject;
msgstring += '&body=' + document.title + ' ' + sendurl + ' ';
msgstring += 'test string' //place message text within single quotes
Give this version a try and see if it does what you want, if you don't
use CGI or the free alternatives listed above:
function mailThisUrl() {
var sendurl = 'http://www.google.com';
var subject = "I thought this might interest you...";
var good = false;
checkEmailAddress(document.eMailer.address.value);
if (good) {
var msgstring = 'mailto:' + document.eMailer.address.value;
msgstring += '?subject=' + subject;
msgstring += '&body=' + document.title + ' ' + sendurl + ' ';
msgstring += 'test string' //place message text within single quotes
window.location = msgstring;
}
}
Please don't top post, it messes up the Q&A flow.
MIke