I have a web site and on each page I have email contact links (Tech Support, Contact Me, etc). What I want to do is when the end user clicks on the link, the email subject line will display a concatenated string that includes the page title.
I know I can hard code the subject line with the page title (without concatenating anything):
<a href="techsupport:contactme@example.com?subject="Technical Issue With Poetry Page">Tech Support</a>
But I don't want to hard code each of the links on every page. Is there a way to concatenate using the Title tag? Would I use StringBuilder? If so, what is the correct syntax?
I am currently using Dreamweaver to develop my site.
08-12-2012, 07:46 PM
SeanPratt
Is there a different language I should use for this?
08-13-2012, 09:33 AM
absolutmgd13
php would be easiest.. otherwise this might work for you.
HTML Code:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>mailto with location</title> </head> <body> <p>Welcome. <script type="text/javascript">
var subj = encodeURI("Have a look at this:- " + window.location.href);
var body = encodeURI("You might find this interesting:- ") + "%0A%0A" + encodeURI(window.location.href);
document.write("<a href=\"mailto:?subject=" + subj + "&body=" + body + "\">Send link to a friend</a>"); </script> <noscript>You do not have Javascript enabled so you cannot send the message.</noscript> </p> </body> </html>