I'm trying to write some code in the <head> like this, but it doesn't work:
<!DOCTYPE html>
<html>
<head>
  <script type="text/javascript">
    document.writeln('<script src="js/messages.js"></script>'); 
  </script>
</head>
<body>
<script>
</script>
</body>
</html>
It prints '); in the page and 
<head>
  <script type="text/javascript">
    document.writeln('<script src="js/messages.js"></script>'); 
  </script>
</head>
in the code.
 
    