JAVASCRIPT TUTORIAL - INTRODUCTION

JavaScript is a very useful tool that is used by almost all web page designers. It is so versatile that a JavaScript "interpreter" is built into all major browsers today.

This tutorial will generally follow the reference book, "Official Netscape JavaScript Book: The Non-programmer Guide To Interactive Web Page", by Peter Kent and John Kent, Ventana Communications Group, Inc, 1996.

I highly recommend that you use HTML-KIT, the best FREE HTML editor on the web! If you would like to see how it works, please Click Here.

All JavaScript statements used in this tutorial can be found in the Appendix - Overview. This is the place to go if you need to refresh your memory on what statements to use for which operations.

Click Here => For A Complete Javascript Reference Manual.

LEARN AS YOU GO
To help you learn as you go, there will be copies of code throughout this tutorial. Most Javascript codes require that there be no word-wrap or line-breaks.

Therefore, I have made all copy & paste codes with a simple form inside a RED box that allows copy & paste without word-wrap or line breaks. This means that when you copy & paste the code into a document, it will work as shown.

Codes that are not shown in a A RED BOX may not work due to word-wrapping or extra spaces in the code.

  1. TO COPY & PASTE:
    Any code you see in a lesson that is inside a red box below can be copied and pasted into a new file using a word processor such as WORDPAD or NOTEPAD, both of which come with your PC and Windows 95|98.

    Some codes should go into a file that already has tags such as <HTML><HEAD>, etc, in it while other code will have all the tags necessary to run correctly.

    To COPY the code,

    1. highlight the code with your mouse
    2. then either
      • use CTRL+C or
      • RIGHT CLICK and select copy from the list to copy the complete code.

    To PASTE the code in your file

    1. first position your mouse at the place in the file where the code will start and then
    2. use either
      • CTRL+V or
      • RIGHT CLICK and select paste.

    The code above requires no tags as the main HTML tags are included. Some other codes will require that the file already have HTML tags in it and that the code be placed between the <body> and the </body>.

  2. Save the file with any name you wish, e.g. mysamplejs.htm, to any folder on your C:/ drive. But I recommend that you set up a new folder especially for use during the learning of javascript,e.g. learning-javascript.

  3. Now start up your browser and then type the location of the file into the LOCATION BAR, e.g. C:/learning-javascript/mysamplejs.htm and press the ENTER KEY. The htm file will display and you should see the same results as those you see on these pages.

To assist you in your study of JavaScript I have made a HTML file, jsexamples.htm, which contains all the examples you will see in this tutorial. There is little if any explanation of the examples in this file; rather I simply put up the code and then it is up to you to look at it, along with the JavaScript.

The JavaScript is contained in the file, myjscodes.js, a file that you can open with a word processor like WORDPAD or NOTEPAD. I also am including a jsstyles.htm which is needed to properly display my comments in the examples. If you are interested in download these files you can get them In This ZIP File.

If you are not familiar with Dynamic HTML and Cascading Style Sheets, then please consult my CSS Tutorial.

As you begin this tutorial please don't be worried about not understanding some concepts at first, e.g. functions. They will be used to illustrate certain principles and will eventually be explained. Just consider the examples as they are given and strive to understand those principles at that time. Everything will be explained in due course.

To begin learning Javascript, please select a topic in the menu at the upper left. I recommend that you go through each topic in the order you see them, i.e. top to bottom.

There are many excellent web page resources for learning JavaScript such as:

REFERENCES

If you have any questions or comments about my help pages or tutorials, please send then to me using my email form.

GeoCities Is Now cASe SenSiTIve!
All files in GeoCities, including yours, are now case sensitive, i.e. the file MyPage.HTML is not the same file as mypage.html.

RECOMMENDATION: Use all lower case for all files, web pages, graphics, music and sounds.


Contents