Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Email:

JavaScript Tutorial Part I- Some Basics

By Will Bontrager
2004-02-09


Orientation

Let's clear up any confusion there may be between JavaScript and Java:

Although they have similar names, they are very
different. Java is a compiled language with modules
that load into your browser from a source external to
the web page. JavaScript, on the other hand, is an
interpreted language and is almost always an integral
part of the web page source code.

"Compiled language" means the source code of the
program is translated (compiled) into machine-language
(composed only of 0's and 1's) before use. When it is
time to run the program, the translated version is
used by the computer instead of the original source
code. Unless you are the programmer, you might never
see the source code of the program you are using.

"Interpreted language" means when it loads a page, the
browser's interpreter uses the original source code
and translates it into machine language. The
translation is stored in the browser's memory ready
to run all or portions of it as appropriate. When the
browser window gets ready to load a different web
page, the previous page's translated JavaScript is
discarded.

JavaScript can be easier to learn than some other languages because there is a great abundance of examples on the internet. Just use your browser's "view source" menu choice and you can see the source code of web pages.

Note: Some browsers will display only the active source
code when you "view source". In other words, you
see only the source code that is actually being used
to display the page at the time you are viewing it.

If you suspect your browser is "censoring" parts of
the source code on a particular page, you can use
Master Snooper. Master Snooper shows you all of the
code in its glory or lack thereof. Just go to
http://willmaster.com/master/snooper/MasterSnooper.cgi
and type in the URL of the web page. (Master Snooper
is also good to see how framed, doorway, and
redirection pages are built, because it shows you
only the source code rather than drawing the display
or getting itself redirected.)

JavaScript can be quick to develop because you can make a change and test it immediately. To set it up, load the source code file into both your word processor and your browser. When you can change something, save the file and click your browser's "reload/refresh" button for immediate feedback.

Be sure to use a plain text word processor. NotePad.exe and BBEdit are both good. I use Arachnophilia (CareWare [no monetary requirements] from http://www.arachnoid.com/arachnophilia -- Windows) for almost all of my HTML and JavaScript development.

Tutorial Pages:
» JavaScript Tutorial Part I- Some Basics
» Orientation
» How the browser knows it is JavaScript
» This is how JavaScript works
» Some programming basics
» How to make your program remember things
» Here it is, all put together
» Using strings of characters
» To come


Copyright 2004 Bontrager Connection, LLC


 | Bookmark
Related Tutorials:
» JavaScript Debugging Techniques with Firebug
» Striped Tables Using JavaScript
» Opening PDFs in a New Window with JavaScript
» Essential Javascript -- A Javascript Tutorial
» Submit Forms Conditionally using JavaScript
» How to Setup a Randomising Function