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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -