JavaScript Tutorial


JavaScript Tutorial

This is part two of the JavaScript tutorial. If you missed the previous lesson, make sure you complete it prior to viewing this JavaScript tutorial.

There are many terms that you will have to learn when it comes to JavaScript. However, you don’t have to learn them right now, before you do any scripting. It is easier to learn the terms as you go along, as this will give you a greater understanding of them. So, we will not be throwing terms out there to confuse or frighten you. However, there are terms that you will need to know – and will come to know – and they need to be noted before you can go any further.

With that said, the first thing you need to know is that JavaScript ‘thinks’ in terms of objects. DOM, which stands for Document Object Model is the foundation of JavaScript. Don’t panic. Just focus on the word object. You know what an object is. It’s a thing. Your computer is an object. Your desk is an object. Let’s look into the computer screen, and you will see other objects. A browser window is an object. A web page is a document, and a document is an object. A graphic on a web page is an object.

As you can see, many objects contain other objects. For instance, the desk contains the computer, which contains the web browser window, which contains the web page, which contains the graphics.

Now, each object has properties. For instance, a web page has a background color, and it uses a certain font. These are properties. But, the background color could also be considered an object, with the property being the actual color. Don’t feel confused. For now, all you need to know is that there are objects and objects have properties.

JavaScripts cause actions to occur on or with objects. These actions are called methods. These methods may be referred to as functions. Functions are methods that you set up to perform a certain task. Method and Function are pretty much interchangeable in this way.

There are just a few more terms to note. Don’t run away! In JavaScript, we also have events, and event handlers. An event is something that happens. In the world of JavaScript, an event is usually something that the website visitor did, such as moving their mouse over a link. That is an event. An event handler comes into play when the event occurs. The event occurs and the event handler calls a JavaScript or reaction into play.

You will learn some other important terms as you go along. Remember, you don’t have to cram all of this into your head right now. These are the basic terms that relate to JavaScript, and you will get to know them as you move forward in this tutorial.

This concludes part two of the JavaScript Tutorial. In the next lesson, you will begin writing your first script.