<s>
The	O
Prototype	B-Language
JavaScript	I-Language
Framework	I-Language
is	O
a	O
JavaScript	B-Language
framework	I-Language
created	O
by	O
Sam	B-Language
Stephenson	I-Language
in	O
February	O
2005	O
as	O
part	O
of	O
Ajax	B-General_Concept
support	O
in	O
Ruby	B-Application
on	I-Application
Rails	I-Application
.	O
</s>
<s>
It	O
is	O
implemented	O
as	O
a	O
single	O
file	O
of	O
JavaScript	B-Language
code	O
,	O
usually	O
named	O
prototype.js	B-Language
.	O
</s>
<s>
Prototype	O
is	O
distributed	O
standalone	O
,	O
but	O
also	O
as	O
part	O
of	O
larger	O
projects	O
,	O
such	O
as	O
Ruby	B-Application
on	I-Application
Rails	I-Application
,	O
script.aculo.us	B-Language
and	O
Rico	O
.	O
</s>
<s>
Prototype	O
provides	O
various	O
functions	O
for	O
developing	O
JavaScript	B-Language
applications	O
.	O
</s>
<s>
The	O
features	O
range	O
from	O
programming	O
shortcuts	O
to	O
major	O
functions	O
for	O
dealing	O
with	O
XMLHttpRequest	B-Protocol
.	O
</s>
<s>
In	O
JavaScript	B-Language
,	O
object	O
creation	O
is	O
prototype-based	O
instead	O
:	O
an	O
object	O
creating	O
function	O
can	O
have	O
a	O
prototype	O
property	O
,	O
and	O
any	O
object	O
assigned	O
to	O
that	O
property	O
will	O
be	O
used	O
as	O
a	O
prototype	O
for	O
the	O
objects	O
created	O
with	O
that	O
function	O
.	O
</s>
<s>
The	O
Prototype	O
framework	B-Architecture
is	O
not	O
to	O
be	O
confused	O
with	O
this	O
language	O
feature	O
.	O
</s>
<s>
The	O
dollar	O
function	O
,	O
$( 	O
)	O
,	O
can	O
be	O
used	O
as	O
shorthand	O
for	O
the	O
getElementById	B-General_Concept
function	O
.	O
</s>
<s>
To	O
refer	O
to	O
an	O
element	O
in	O
the	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
(	O
DOM	B-General_Concept
)	O
of	O
an	O
HTML	B-Language
page	O
,	O
the	O
usual	O
function	O
identifying	O
an	O
element	O
is	O
:	O
</s>
<s>
Note	O
:	O
Like	O
the	O
underscore	O
( _	O
)	O
,	O
the	O
$	O
character	O
is	O
a	O
legal	O
"	O
word	O
character	O
"	O
in	O
JavaScript	B-Language
identifiers	O
,	O
and	O
has	O
no	O
other	O
significance	O
in	O
the	O
language	O
.	O
</s>
<s>
It	O
was	O
added	O
to	O
the	O
language	O
at	O
the	O
same	O
time	O
as	O
support	O
for	O
regular	B-Language
expressions	I-Language
,	O
so	O
that	O
the	O
Perl-like	O
matching	O
variables	O
could	O
be	O
emulated	O
,	O
such	O
as	O
$`	O
and	O
$	O
 '	O
.	O
</s>
<s>
The	O
dollar	O
dollar	O
function	O
is	O
Prototype	O
's	O
CSS	B-Language
Selector	O
Engine	O
.	O
</s>
<s>
It	O
returns	O
all	O
matching	O
elements	O
,	O
following	O
the	O
same	O
rules	O
as	O
a	O
selector	O
in	O
a	O
CSS	B-Language
stylesheet	I-Language
.	O
</s>
<s>
If	O
you	O
are	O
using	O
the	O
script.aculo.us	B-Language
extension	O
of	O
the	O
core	O
Prototype	O
library	O
,	O
you	O
can	O
apply	O
the	O
"	O
pulsate	O
"	O
(	O
blink	O
)	O
effect	O
as	O
follows	O
:	O
</s>
<s>
In	O
an	O
effort	O
to	O
reduce	O
the	O
amount	O
of	O
code	O
needed	O
to	O
run	O
a	O
cross-browser	O
XMLHttpRequest	B-Protocol
function	O
,	O
Prototype	O
provides	O
the	O
Ajax	B-General_Concept
object	O
to	O
abstract	O
the	O
different	O
browsers	O
.	O
</s>
<s>
It	O
has	O
two	O
main	O
methods	O
:	O
Ajax.Request( )	O
and	O
Ajax.Updater( )	O
.	O
</s>
<s>
There	O
are	O
two	O
forms	O
of	O
the	O
Ajax	B-General_Concept
object	O
.	O
</s>
<s>
Ajax.Request	O
returns	O
the	O
raw	O
XML	O
output	O
from	O
an	O
AJAX	B-General_Concept
call	O
,	O
while	O
the	O
Ajax.Updater	O
will	O
inject	O
the	O
return	O
inside	O
a	O
specified	O
DOM	B-General_Concept
object	O
.	O
</s>
<s>
The	O
Ajax.Request	O
below	O
finds	O
the	O
current	O
values	O
of	O
two	O
HTML	B-Language
form	O
input	O
elements	O
,	O
issues	O
an	O
HTTP	O
POST	O
request	O
to	O
the	O
server	O
with	O
those	O
element	O
name/value	O
pairs	O
,	O
and	O
runs	O
a	O
custom	O
function	O
(	O
called	O
showResponse	O
below	O
)	O
when	O
the	O
HTTP	O
response	O
is	O
received	O
from	O
the	O
server	O
:	O
</s>
<s>
The	O
framework	B-Architecture
function	O
Object.extend(dest, src )	O
takes	O
two	O
objects	O
as	O
parameters	O
and	O
copies	O
the	O
properties	O
of	O
the	O
second	O
object	O
to	O
the	O
first	O
one	O
simulating	O
inheritance	O
.	O
</s>
<s>
Unlike	O
other	O
JavaScript	B-Language
libraries	I-Language
like	O
jQuery	B-Language
,	O
Prototype	O
extends	O
the	B-General_Concept
DOM	I-General_Concept
.	O
</s>
<s>
In	O
April	O
2010	O
,	O
blogger	O
Juriy	O
'	O
kangax	O
 '	O
Zaytsev	O
(	O
of	O
Prototype	O
Core	O
)	O
described	O
at	O
length	O
the	O
problems	O
that	O
can	O
follow	O
from	O
monkey	B-Application
patching	I-Application
new	O
methods	O
and	O
properties	O
into	O
the	O
objects	O
defined	O
by	O
the	O
W3C	O
DOM	B-General_Concept
.	O
</s>
<s>
Cross	O
browser	O
issues	O
:	O
host	O
objects	O
are	O
not	O
subject	O
to	O
rules	O
,	O
non-compliant	O
IE	O
DOM	B-General_Concept
behavior	O
,	O
etc	O
.	O
</s>
<s>
By	O
2008	O
,	O
specific	O
issues	O
with	O
using	O
DOM-extension	O
methods	O
in	O
older	O
versions	O
of	O
Prototype	O
,	O
combined	O
with	O
newer	O
versions	O
of	O
current	O
browsers	O
,	O
were	O
already	O
being	O
documented	O
.	O
</s>
<s>
Rather	O
than	O
adding	O
new	O
methods	O
and	O
properties	O
to	O
pre-existing	O
'	O
host	O
 '	O
DOM	B-General_Concept
objects	O
such	O
as	O
Element	O
,	O
like	O
element.hide( )	O
,	O
the	O
solution	O
to	O
these	O
issues	O
is	O
to	O
provide	O
wrapper	O
objects	O
around	O
these	O
host	O
objects	O
and	O
implement	O
the	O
new	O
methods	O
on	O
these	O
.	O
</s>
<s>
jQuery	B-Language
is	O
such	O
a	O
wrapper	O
object	O
in	O
the	O
library	O
of	O
that	O
name	O
.	O
</s>
