language and is based on an object model that allows you to control user
interaction with HTML pages.
an HTML document (which increases the size and complexity of the HTML
code in which they are embedded.
C++. (Java does not support pointers and memory allocation programming,
which are complex components of C and C++.)
- Display messages to the user, either as part
of a web page or in alert boxes.
- Animate images or create images that change
when you move the mouse over them.(rollovers)
- To trap events such as moving the mouse over a
certain area of the screen.
- Request information from a server and display as needed, without reloading the whole page(AJAX)
- Show or hide content based on user interaction
- Customize interface elements like scrolbars
- Add newer functionality to older browsers(Shims or Polyfills)
- html5 shim used to enable Internet Explorer 8 and earlier to recognize and style newer HTML5 elements such as article, section, and nav.
- Create lightbox style galleries
- Create slideshows
- Detect the browser in use and display different
content for different browsers.
- Detect installed plug-ins and notify the user
if a plug in is required.
- As a scripting language to handle user events, like clicking on a form element. You can add dynamic
mechanisms to your page that would have previously required CGI scripts.
For example, you can display fonts in a larger or smaller type style.
in a form before sending data to the server, acting as a buffer between Web servers and clients.
For example, if you have a form that requests an email address, you
can check to see if the cell contains an @ sign or some text data before
is done at the client. This acts as a buffer for the Web server by off-loading
processing tasks. With a CGI script (such as PERL), data must go back
and forth between client and Web server.
- As a control language for HTML page elements.
You can build programming logic into
For example, you can alter the content of a Web page based on day of
the week, date, time, and user domain.
access your Web site.
For example, when user Ryan accesses your Web site, you can display
a message such as Good Morning Ryan.
- As a downloadable computation engine.
Web sites have implemented calculators and tax calculation forms using
the Web server, computed, and the result returned to the client.)
- To generate answers to a users follow-up
This way a user will never see irrelevant questions. You can
create a friendly interface for distributing data.
- To create spreadsheets and worksheets.
- To display text.
- Add scrolling or changing messages to the browsers
- and more...
Some programming languages must be compiled, or translatd
hand, is an interpreted language: the browser executes each
and acted upon by the browser in a top-down manner.
used to define the function or object.
For example, a function named fieldBox1() must be referenced in the program
as fieldBox1() using the uppercase B in box.
Single-line comments start with a double-slash (//).
within a line. Typically, slashes are placed as
after the slashes until it reaches the end of the line.
Multi-line comments begin with a slash-asterisk
(/*) and end with an asterisk-slash (*/).
The interpreter ignores comments between the /* and */ combination.
digits, or underscores.
are loosely typed like in Perl. In Java, C, and C++, variables
are tightly typed, which means they are strictly assigned a type (integer
or string) and cannot change types after being assigned.
All quotation marks must be in pairs. A
single and double quote must have a corresponding single and double quote.
in an HTML document, such as frames, buttons, links, and other objects.
- An object can be a button, form, document, window,
frame, or URL.
- Each object has properties such as methods, colors,
values, names, and the location on a screen within a window.
For example, a coin has certain characteristics, such as the shape, color,
thickness, weight, and the type of figure embossed on each side. This
helps distinguish it from other objects like a car, which has properties
such as horsepower, size of wheels, and color.
identify relationships between objects and references to objects in HTML
because it uses dot notation.
For example, if you are working with the name of a document, the construct
will look like this:
The NAME attribute you use when creating HTML documents
Some objects can share the same properties.
For example, a coin object and a car object of the same color share the
same property. An objects properties help differentiate it from
an HTML page, the browser creates objects corresponding to the page. You
Objects originate from many sources. They can
are established when you load an HTML document and the browser creates
them for you. All elements of a Web page, such as forms, windows, frames,
and links, are examples of built-in objects. Each object in turn has
its own set of methods and properties.
- Created by you. You can create functions to
define new object types.
- Created by others. You can use Web pages containing
Hierarchical Structure/Document Object Model (DOM)
In this hierarchy, an object's descendants
are properties of the object.
For example, a form named form1 is an object as well as a property
of document, and is referred to as document.form1
To identify the value of a text field in a form you
must reference the value as follows: document.form.text.value
where form is the name assigned to the form and text is
the name assigned to the input text field in the form.
- Create a set of commands or subroutines called a
- Define conditional constructs that respond differently
based on some value, situation, or input.
- Create looping constructs using if, then, and else
a users action.