Intro to JavaScript

JavaScript is a powerful, object-based scripting language; JavaScript programs can be embedded directly in HTML web pages. When combined with the Document Object Model (DOM) defined by a web browser, JavaScript allows you to create Dynamic HTML content and interactive client-side web applications. JavaScript syntax is based on the popular programming languages C, C++, and Java, which makes it familiar and easy to learn for experienced programmers. At the same time, JavaScript is an interpreted scripting language, providing a flexible, forgiving programming environment in which new programmers can learn.

Let's check out some JavaScript special effects.

We can use innerHTML to change a loaded page (HERE).

Or, we could get ideas from others like the TinyBox code provided by Michael Leigeber. This script provides a neat effect for a modal window that can accept any AJAX or HTML input. For example, a Picture, or a Web page, a PopUp Ad, or your favorite YouTube video.

In this chapter, we will take a a look at how to create Web pages whose content and layout can be modified using built-in programs. In our discussion of Forms, we learned about accessing programs involving forms and CGI scripts and running programs that are stored and run off the Web server. Here are some disadvantages to this approach:

  1. users have to be connected to the Web server to run the CGI script
  2. only the programmer of the script can alter the script
  3. the system administrator of the Web server can place limits on how users can access the script
  4. continually accessing the server can slow it down and overload the system

These issues led to the development of programs, or scripts, that could be run from the Web browser on the user's own computer (the client) as illustrated below.

Client-side programs solve many problems associate with CGI scripts. Computing is distributed over the Web so that no one server is overloaded with handling programming requests. Since the user does not have to wait for data to be sent over the Internet to the Web server, client-side programs are likely to be more responsive to the user. Client-side programs can never completely replace CGI scripts because needed data is stored on the server.


Learn JavaScript in One Hour and thirty seven minutes

WARNING: It is fast... :-)