JavaScript is a text-based programming language used both on the client-side and
server-side that allows you to make web pages interactive. Where HTML and CSS are
languages that give structure and style to web pages, JavaScript gives web pages
interactive elements that engage a user.
JavaScript contains a standard library of objects, such as Array, Date, and Math, and a
core set of language elements such as operators,
control structures, and
statements. Core JavaScript can be extended for a variety of purposes by supplementing
it with additional objects;
for example:
-
Client-side JavaScript extends the core language by supplying objects to control a
browser and its Document Object Model (DOM).
For example, client-side extensions allow an application to place elements on an HTML form and respond to user events such as mouse clicks,
form input, and page navigation. -
Server-side JavaScript extends the core language by supplying objects relevant to
running JavaScript on a server.
For example, server-side extensions allow an application to communicate with a database, provide continuity of information from one invocation to another of the application,
or perform file manipulations on a server.