This is a basic piece of code that write a couple of links to the webpage:
in the xhtml file (1.0 Strict): <script type="text/javascript" src="file.js"></script>
in the file.js file:
document.write("<p><a href="link1.html">Title</a></p>");
document.write("<p><a href="link1.html">Title</a></p>");
document.write("<p><a href="link1.html">Title</a></p>");
document.write("<p><a href="link1.html">Title</a></p>");
The links aren't there, the titles are there, THERE IS NOTHING THERE!!!!! =/