Automatic e-mail link with topic information
filed in Technical Writing on Feb.25, 2008
This javascript automatically creates a mailto link with information about the topic in the subject line. Include this in your help systems for a quick and dirty response mechanism.
This script works by parsing the innerHTML value from the first H1 tag on the page, so it needs to be placed after the first H1 in the document.
<script>
var s = "you@example.com";
var p = escape(document.getElementsByTagName("H1")[0].innerHTML + " (" + window.location.href.substring(window.location.href.lastIndexOf("/")+1) + ", Last modified on " + document.lastModified + ") ");
document.write('<a href="mailto:' + s + '?subject=' + p + '">Send feedback on this topic</A>');
</script>
Leave a Reply