Before learning JavaScript, it's important to learn how it fits into the larger picture of the Browser and DOM (and your web app).
To start, lets walk through a very basic "Hello World" web page. Assume that the server at helloworld.com has this HTML file:
<html>
<head>
<script type='text/javascript'>
alert('Hello JS');