E-Books for you
PARTS:
Part 2
Part 3
Part 4
Part 5
Part 6
Part 7
Part 8
Part 9
Part 10
Part 11
Part 12
Part 13
Part 14
Part 15
SEARCH
0-9
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Resources
Prev
|
Current Page 101
|
Next
Jonathan Snook, Aaron Gustafson, Stuart Langridge, and Dan Webb
"Accelerated DOM Scripting with Ajax, APIs, and Libraries"
All elements have
a generic set of methods and properties that they share, but certain elements, such as
the
element, define their own methods and properties while inheriting the
methods and properties from the generic element.
??? Polymorphism allows for the same method name on two different subclasses to exhibit
different behavior. For example, you might have two different Ajax subclasses: one for
JSON calls and one for XML calls. Each could have a template method that takes the
Ajax response and turns it into an HTML snippet. Although both inherit the Ajax communication
functions from the Ajax parent class, the template methods need to act
differently because of the different data formats. (If the difference between JSON and
XML is lost on you, not to worry: Ajax, JSON, and XML are covered in Chapter 4.)
JavaScript, being a prototype-based language, wasn??™t designed to work like class-based
languages such as Java or C++. However, these features can still be re-created using JavaScript??™s
paradigm. Many developers who come from other classic OOP languages design their scripts to
act and behave much like the languages they are familiar with. Having knowledge of what these
OOP concepts are will strengthen your programming skills.
Now, let??™s get into the fun stuff.
Functions
In JavaScript, functions are at the very core of OOP because functions are objects. They provide
the bare-bones structure to enable attaching methods and properties.
Pages:
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Schaum's Outline of Principles of Computer Science (page 376)
Practical Reporting with Ruby and Rails (page 46)
Foundation Flex for Designers (page 117)