Greetings...

How can a fellow include an external javascript file inside a document.write method?

I have used the following:

<head>
<script type="text/javascript">
function fName() {
document.write('<script language="text/javascript" src="./file.js"><\/script>');
}
</script>
</head>
<body onload="fName();">

</body>

The onload event is triggered when the page has loaded...Document.write tries to write to the document that executes the write method....

If i have said something wrong, do correct me please....

So far so good...When the page executes the document.write CLEARS the content of the page and writes new content...!!!!!!

Do i need to place the script inside the body element to prevent the above from happening???


Thanx in advance!!!!!