I have the following code. It works in an html document. I would like to move the script in the head to an external .js document. Still very new at this and so far everything I've seen has to do with functions, but I want to assign the variables in the .js doc so they're not viewable in the html. Any help would be appreciated. Thanks!
<html>
<head>
<script type="text/javascript">
var userName = "exampleaddress";
var emServer = "exampledomain.com";
var tagLine = "?subject=Questions/Comments Re: exampledomain.com";
var emLink = userName + "@" + emServer + tagLine;
</script>
</head>
<body>
<script>
document.write("<a href='http://www."+emServer+"'>");
document.write(emServer);
document.write("<a>");
</script>
<br>
<script>
document.write("<a href='mailto:"+emLink+"'>");
document.write(userName);
document.write("<a>");
</script>
</body>
</html>