25-08-2017, 09:32 PM
Essential Javascript -- A Javascript Tutorial
Javascript.pdf (Size: 234.06 KB / Downloads: 32)
INTRODUCTION
Javascript is an interpreted language with a C like syntax. While many people brush the language
off as nothing more than a browser scripting language, it actually supports many advanced
concepts such as object-oriented-programing, recursion, lambda, and closures. It's a very
approachable language for the beginner that quickly scales to be as powerful a tool as your skills
allow.
This reference will cover the basic language constructs. This is not a beginner's guide to
programming. This article focuses on bringing people who already know another programming
language up to speed on Javascript methodology. Additionally, this is not an exhaustive language
definition, it is a broad overview that will occasionally focus in on some more advanced
concepts. It's here to get you started, other articles will focus on making you an expert.
External Javascript
External Javascript is where things get interesting. Any time you have a block of code which you
will want to use on several different web pages you should place that block in an external
Javascript file. The clock on the upper right-hand corner of this page is a good example. The clock
appears on almost every page on this site and so it is included in my "common.js" file. Every
web-page on the site will load this file and so the clock is available to all of my web-pages.
There's nothing fancy about an external Javascript file. All it is, is a text file where you've put all
your Javascript. Basically everything that would ordinarily go between the <script> tags can go
in your external file. Note that between was stressed, you can not have the <script> </script>
tags themselves in your external file or you will get errors.
The biggest advantage to having an external Javascript file is that once the file has been loaded,
the script will hang around the browser's cache which means if the Javascript is loaded on one
page then it's almost a sure thing that the next page on the site the user visits will be able to load
the file from the browser's cache instead of having to reload it over the Internet (This is an
incredibly fast and speedy process).
Javascript is case sensitive.
It should also be noted, before we begin, that Javascript is extremely case sensitive so if you're
trying to code along with any examples make sure lowercase is lowercase and uppercase is
uppercase. For the most part Javascript is also a camel-cased language. That is, if you're trying to
express more than one word you will eliminate the spaces, leave the first letter uncapitalized
and capitalize the first letter of each word.
Conclusion
As stated at the beginning of this article, this document is intended to bring a programmer up to
speed in Javascript, and is not an exhaustive review of the language. This article is a part of a
larger series of reference articles (listed at the top of the page). As you master the fundamentals
introduced on this page, it's recommended that you visit the other reference articles to master
the details of the language.
Javascript is a surprisingly deep and well considered language (with a few notable and notorious
exceptions). It is simple enough for beginners to programming to understand and scales to
become as advanced as you need it to be. While it may be frustrating to work around the various
idiosyncrasies of all the browser models and versions, Javascript itself is a joy to work in, and
when developing web-applications, the least and most unobtrusive of all the problems you will
have to surmount.