HTML and CSS Reference
In-Depth Information
Why Use JavaScript?
Using JavaScript enhances your Web page by adding interactivity to it. Users can receive
instant feedback, without complicated Common Gateway Interference ( CGI ) scripts and
languages. A CGI script is any program that runs on a Web server for the purpose of pro-
cessing data. The Web page sends the data to the server that processes the data and may
return a result to the Web page. Along with server-side scripts and programs, many Web
sites use CGI for searching databases or processing purchase orders on a server.
The disadvantage of using CGI scripts is that they waste resources when the
needed task can be processed on the user's computer. For example, with JavaScript you
can validate a data-entry form, such as a purchase request, immediately on the user's
computer. The need to send the data back to the server for validation is eliminated. The
user receives feedback instantly and does not have to wait for a response during heavy
Internet traffic times.
Reserved Words
Reserved words (also called keywords ) are words with special meaning to a programming
language. Most reserved words are used in program statements or in defining data. A reserved
word cannot be used as a JavaScript variable, function, method, or object name. Table G-1
contains a list of ECMA specification and typical browser reserved words for JavaScript.
Table G-1 Reserved Words
abstract
double
in
throw
boolean
else
instanceof
throws
break
enum
int
transient
byte
export
label
true
case
extends
long
try
catch
false
native
typeof
char
inal
new
var
class
finally
null
void
const
float
return
volatile
continue
for
short
while
debugger
function
super
with
default
goto
switch
delete
if
synchronized
do
import
this
Some of the reserved words have special meaning to JavaScript; some are reserved for
future use with JavaScript extensions. Table G-2 lists these future reserved words.
Table G-2 Future Reserved Words
implements
package
public
interface
private
static
let
protected
yield
Search WWH ::




Custom Search