I have written a script in plain Java Script (for cross platform compatibility) to add a refer this page to a friend section on my site. I?m not ready to try a Unix CGI script yet so would like to stick with the JS. Here is the script
The first problem is with the ?&? in this line.
parent.location.href=’mailto:’+ email + ??subject? + subject + ‘&body=’+ body + ”;
I get an Object expected error. If I remove it and just use the body it will work but with no subject in the e-mail. I think that it needs to be escaped but can?t find it in my books.
The second problem is with terminating the script after the two ?name? alerts.
A simple break wont work even tried to put it in a loop to do that, no go. I also tried to capture the onclose event of the alert window but kept getting Object expected error. Thank you. Points will be given to the first working answer or divided between the two parts.