Learning JavaScript - Introduction (Lesson 1) PDF
Learning JavaScript - Introduction (Lesson 1) PDF
INTRODUCTION
(Lesson 1)
Good Evening! Welcome to the Beginning JavaScript Class. Here you will
learn how to jazz up your web pages with a little JavaScript. As you may have
guessed, you have already experienced some of the power of JavaScript. The
greeting, Good Evening , changes depending on the time of day you visit this
page. Cool huh! You will learn to do this and many other things in this beginning
JavaScript Class.
The purpose of this first lesson is to help you understand what tools you need to
effectively work in this class. I will also explain what tools are already provided. I
recommend that you read though this lesson thoroughly so that you will
understand how to use the available tools in this class.
Notepad is a adequate for writing scripts on the PC. However, a far better
choice is EditPad, a Notepad replacement, that is available on the author's web
page for only the cost of sending him a postcard. EditPad allows you to have
many documents open at once which is invaluable for cutting and pasting.
EditPad has some other really nice features including a find and replace feature
that I constantly use and a display of the line number that the cursor is on which
is really useful when tracking JavaScript errors.
javascriptmall.com/learn/lesson1.htm 1/4
10/11/2009 Learning JavaScript - Introduction (Les…
You can get a free copy of the Netscape browser here and a free copy of the
Microsoft Internet Explorer browser here.
Recommended Book
A b o o k is no t ne e d e d fo r this c o urs e . I have tried to include adequate
material and on-line resources here so that you do not need a book to learn
basic JavaScript. After you complete this course or become convinced that
JavaScript is your thing, you might visit our book section and look at some
books I recommend there. If you are still a little shaky about HTML or want a
good reference, there is an excellent book recommended there that is very
inexpensive. The book that I always recommend for the person that is a
JavaScript enthusiast is JavaScript Bible. It is the best, but understand that it is
not for the beginner. And yes, I do have a recommendation for a good
beginner's book to supplement this class if you are interested.
On-line Documentation
Listed below are several sources where you can learn more about JavaScript.
The first two are the books that Netscape has on-line that cover the version of
JavaScript we will be discussing in this Class. These two books are included in
our Library that is discussed in the next section. The next one is the
documentation for Netscape's most recent browsers. The next link is for the
documentation of J Script, Microsoft's version of JavaScript. Be aware that this
documentation takes a different approach to the one I will be teaching here.
Sizzling HTML Jalfrezi is my favorite reference for HTML. You can setup a
personal book shelf on the Macmillan Computer Publishing site which has
several JavaScript books that you can read for free.
javascriptmall.com/learn/lesson1.htm 2/4
10/11/2009 Learning JavaScript - Introduction (Les…
Covers Netscape 4.06+ and 4.5+
Additional References
Assignments
The best way to learn JavaScript is by writing and debugging scripts. Most
lessons will have assignments that involve developing some scripts. I
recommend that you make a web page that contains your solutions to the script
assignments that you update on a per Lesson basis. Feel free to be innovative
and go beyond the basic requirements.
I will post my solutions for the script assignments in each lesson. Understand
that all of the script assignments will have more that one satisfactory solution
and that yours might be a better approach than mine.
Please do not get discouraged by the fact that most of the assignments in the
first lessons do not have any practical value except to teach you something
about JavaScript. The assignments will become more practical as we learn
more of the necessary JavaScript techniques.
Netscape and Microsoft determined that displaying this dialog box every time a
error occurs is annoying to most people and thus is releasing their newer
version browsers with this feature off by default. The affected browsers are:
Netscape 4.06+
Netscape 4.5+
javascriptmall.com/learn/lesson1.htm 3/4
10/11/2009 Learning JavaScript - Introduction (Les…
Internet Explorer 5.0+
If you will be using one of these browsers in this class, then you need to make
some special adjustments so that you will be able to see JavaScript errors
when they occur. The purpose of the section is to guide you as to how to make
these adjustments.
You may want do the setup below in conjunction with Lesson 2. We will be
demonstrating a JavaScript error in that lesson.
There are two ways to display error messages in these Netscape browsers.
The easiest is to just type javascript: into your Location box and press the
Enter key prior to doing any JavaScript development. This will bring up
Netscape's Communicator Console. You will need to leave this console open
while you are developing JavaScript so that errors can be displayed in it.
The second method requires that you modify your prefs.js file. This is the
method I recommend for this class. The procedure for this is covered in
Appendix C Displaying Errors with the JavaScript Console of the Netscape
JavaScript guide for version 1.3. There are instructions there for setting up your
copy of Netscape to open the Console when an error occurs. There are also
instructions for setting it up to open an error dialog box. I could not get the error
dialog box to open but the console setup works fine.
To turn on the JavaScript Error dialog box in the Internet Explorer, first click on
the T o o ls tab of the menu and select Inte rne t Op tio ns . This will open the
Internet Options window. Click on the Ad v a nc e d tab. Locate the check box for
"Display a notification about every script error" and make sure it is checked.
Then click OK.
Assignment
1. Download and become familiar with any browsers and text editors that
you would like to use for this class.
2. Review any HTML documentation you have if it has been a while since
you worked with it.
3. Visit the sites listed in our library. Try to get a basic familiarity with what
they have and an understanding of how the site is organized.
javascriptmall.com/learn/lesson1.htm 4/4