Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

01 Overview


Up to the mid - 90 's HTML programmers had to depend on server-side CGI programs
to provide user interaction with a web page.  Early versions of JavaScript (LiveScript
by Netscape and JScript by Microsoft) came primarily from the need for form validation
and dynamic page content creation, tasks previously possible only through CGI programs.
Having an embedded programming language within the page reduced the time - consuming
connections between PC and server and gave HTML programmers significantly more
control over the content of their pages.

Evenutally an ISO stanrdard was released defining a global standard for the language.
You may see it referred to as ECMAScript.

JavaScript programs are written in simple text and are embedded within an HTML page.  The
browser reads and executes the programs.  External JavaScripts are also allowed.

JavaScript is an object based language. The window.document is the highest level
object most used by programmers.  From it, programmer 's can access all HTML tag properties.

JavaScript programs can modify any of the content of a web page - text and images, but for security
reasons are constrained from making any changes to the users PC.  JavaScripts may not read / write files
on the user 's PC, cannot access user information nor send user information over the Internet.

JavaScript programs are written into the HTML program using plain text.  The browser executes the program
as it reads it - with the exception of JavaScript functions which are run only when called.

HTML pages may contain multiple scripts, which can share data.

Generally, JavaScript is placed in the head of a page so that scripts or variables needed in the body of the
HTML page will already have been declared in the head by the time they 're needed.

JavaScript can be used in 4 places inside an HTML file :
1. Inline
2. Event handlers
3. replacement of URLs
4. as attribute values

Some of the many uses of JavaScript include :

Navigation  User Information  Web Sites
--------------------------    --------------------------
Frame breaker cookies   guestbook
Alerts   browser ID  bookmark a page
Prompts   screen size  add to favorites
PopUp Windows     send URL to a friend
Menus       count # of visits
Status bar      get USER IP address
Email a page to someone   code generators
Disallow use of right click  print this page

Apps   Visual Effects  Games / Humor
----------------------------    ----------------------
clock   mouseovers   moving eyes
calendar  slideshow   security
calculation  animation   password
color picker images
ramdom message watermark
    statusbar
    banner
    background
    text effects
    music
    mouse cursor