Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Create this in external JS file please


phillipe - 10:25 pm on Jul 5, 2012 (gmt 0)


Hello,
The following HTML code does not validate in W3C HTML Validator (http://validator.w3.org/).
How can I place the javascript function in an external JS file?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>

<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 + "&amp;body=" + body + "\">Send link to a friend</a>");
</script>
<noscript>You do not have Javascript enabled so you cannot send the message.</noscript>

</body>
</html>


Any ideas appreciated.
Kind regards,
Phil


Thread source:: http://www.webmasterworld.com/javascript/4473018.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com