Can I dynamically set the recipient of mailto: using only HTML and JavaScript depending on URL used to access the site? -
i have 5 different websites use same privacy html page depending on site accessed want email change dynamically.
for example, lets access privacy page site , click privacy@example.com send email want email sent privacy-sitea@example.com, if access same privacy page site b , click same email want send privacy-siteb@example.com.
is possible html , javascript?
thanks!
var l=window.location+''; l=l.replace(/http(s*):\/\/(www\.)*/,''); l=l.split('/')[0]; //get domain var mailto='privacy-'+l+'@example.com';
Comments
Post a Comment