T
a
k
e
n
f
r
o
m
t
h
e
f
o
r
t
h
c
o
m
i
n
g
t
i
t
l
e
'
F
o
u
n
d
a
t
i
o
n
s
o
f
A
j
a
x
'
t
o
b
e
p
u
b
l
i
s
h
e
d
b
y
A
p
r
e
s
s
i
n
O
c
t
o
b
e
r
2
0
0
5
.
I
S
B
N
1
5
9
0
5
9
5
8
2
3
C
o
p
y
r
i
g
h
t
©
2
0
0
5
R
y
a
n
A
s
l
e
s
o
n
a
n
d
N
a
t
h
a
n
i
e
l
T
.
S
c
h
u
t
t
a
Building the Ultimate
Ajax Developer’s Toolbox
As an experienced Web application developer, you’re likely adept at applying a particular
server-side technology (or, perhaps, applying several server-side technologies) to build Web
applications. The past few years have seen a large push to make sever-side software develop-
ment easier and more robust, while the client side has been mostly ignored. The advent of
Ajax techniques has changed that, as developers now have a larger client-side toolbox with
which to work. You may not be used to working with large amounts of HTML, JavaScript, and
CSS, but implementing Ajax techniques will force you to do so. This chapter introduces you to
some tools and techniques that will help make developing Ajax applications a little bit easier.
This chapter is not an in-depth tutorial but rather provides a jump start on a number of useful
tools and techniques.
Documenting JavaScript Code with JSDoc
JavaScript, like many other programming languages, suffers from a basic flaw in the average
software developer’s psyche: it is often easier to write (or rewrite) a certain piece of functional-
ity than it is to read some existing code and figure out how it works. Properly adding comments
to code while writing the code can greatly reduce the amount of time and effort required by
other developers to understand how the code works, especially when it comes time to modify
the functionality of the code.
The Java language was introduced with a tool called javadoc. This tool produces API
documentation in HTML format from documentation comments in the source code. Any
Web browser can easily read the resulting HTML, and since it’s rendered as HTML, it can be
distributed online, which provides developers with easy access to it. Providing the API docu-
mentation in an easily browsable format often eliminates the need for developers to inspect
source code to figure out how a certain class or method behaves and how it should be used.
JSDoc is a similar tool for JavaScript (jsdoc.sourceforge.net). JSDoc is an open-source
tool that is licensed under the GNU Public License (GPL). JSDoc is written in Perl, meaning
that Windows users will have to install a Perl runtime environment. (Perl is a standard part of
most Linux and Unix operating systems.)
131
CHAPTER 5
■■■