I suspect you mean Javascript.
Do you no that Javascript has nothing to do with Java? None of those two languages was derived by another one or even influenced.
Java is not used for scripting, it's totally based on compilation to byte code.
[EDIT 1]
After all those down-votes, I can see someone won't understand until I repeat: the question asks about "java script". There is no such thing! If the question was about Javascript, I want to see exactly this name in the title and body of the question.
If it is Java, I explain that it is something that has nothing to do with Javascript.
[EDIT 2]
If this is not enough, watch this:
http://www.youtube.com/watch?v=u9_kahA_wQo[
^].
Better now?
[EDIT 3]
Now when the misunderstanding about the scripting language is probably cleared: about position of the script.
There are two places: a script in external file (let's place it in "scripts/mylib.js") and embedded in HTML. Let me show both cases below:
<html>
<head>
<title>My title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="./scripts/mylib.js" />
<script type="text/javascript"><!--
--></script>
</head>
<body>
<!--
</body>
</html>
—SA