prototype.js引含符谢引含符谢引含符谢引含符谢TableofContents1.ProgrammingGuide1.1.Prototype期个传传期?1.2.别量脚狡易x符1.3.造用性易洁1.3.1.候p用$()易洁1.3.2.候p用$F()易洁1.3.3.候p用$A()易洁1.3.4.候p用$H()易洁1.3.5.候p用$R()易洁1.3.6.候p用Try.these()易洁1.4.Ajax少质而1.4.1.候p用Ajax.Request紧l1.4.2.候p用Ajax.Updater紧l2.prototype.js含而2.1.JavaScript紧l真u按山理2.2.少Object紧l真u按山理2.3.少Number紧l真u按山理2.4.少Function紧l真u按山理2.5.少String紧l真u按山理2.6.少documentDOM少质而真u按山理2.7.少Event少质而真u按山理2.8.在prototype.js传。少传树真u易少质而哪}紧l2.9.PeriodicalExecuter少质而2.10.Prototype少质而2.11.Class少质而2.12.Ajax少质而2.13.Ajax.Base紧l2.14.Ajax.Request紧l2.15.options含易a少质而2.16.Ajax.Updater紧l2.17.Ajax.PeriodicalUpdater紧l2.18.Element少质而2.19.Abstract少质而2.20.Abstract.Insertion紧l2.21.Insertion少质而2.22.Insertion.Before紧l2.23.Insertion.Top紧l2.24.Insertion.Bottom紧l2.25.Insertion.After紧l2.26.Field少质而2.27.Form少质而2.28.Form.Element少质而2.29.Form.Element.Serializers少质而2.30.Abstract.TimedObserver紧l2.31.Form.Element.Observer紧l2.32.Form.Observer紧l2.33.Abstract.EventObserver紧l2.34.Form.Element.EventObserver紧l2.35.Form.EventObserver紧l2.36.Position少质而(颜u太易x检至)触w真狡期树1.3.1Chapter1.ProgrammingGuide1.1.Prototype期个传传期期个传传期期个传传期期个传传期?或谢候编造洁期用造少t?prototype.js期个个个由候SamStephenson别真uJavaScript化。造个树u性始易始编别范踪始n真u个比别高少树别别高少树别别高少树别别高少树别真u个比传码少按p按别造脚少按(符?高传传性WEB引用稍引真u量按。造l树o化别荐Web2.0狡面性。始s树候编期造候照高}传w造个稍引化?候编性y含脚传含理易x检至引错个期个少t真u性太颜面传楚个。像按引期在或传楚化比真u引含而个检(?或含脚个始化按洁造prototype.js真u漫传码传。引错个谢高}别错传。真u比个个都别。或感性照或少W传编传真u易候谢别符谢照哪含别传编别错传传少传性y个错。或传P个踪间插候传w造个化真u少质而?紧l?易洁哪}按山理真u面紧少易含而。1.2.别量脚狡易x符别量脚狡易x符别量脚狡易x符别量脚狡易x符高编JavaScript按含由1.3.造用性易洁造用性易洁造用性易洁造用性易洁造个稍引化量面脚化含传w谢太颜u少传树真u少质而哪}造用性易洁。编别造传易洁真u易期山真u真真u山候期个传太传w别少候编太量真u量太编码哪}感用洁。1.3.1.候p用候p用候p用候p用易洁易洁易洁易洁易洁期个在DOM传。候p用造传颜编性真u易洁真u个个候别真u箭鼠别?山候像造个DOM易洁个检(?造个易洁造在含易a传别荐真uid真u都个别或紧。比踪间DOM传。真u易洁?造个期脚个箭面。候编含传传别荐太个id候符传太含易a照哪含造在个个带期按引期触r洁感真u别或紧真u个个少质而。个面脚真u候少漫传含候编插造造传。HTMLHEADTITLETestPage/TITLEscriptsrc=prototype-1.3.1.js/scriptscriptfunctiontest1(){vard=$('myDiv');alert(d.innerHTML);}functiontest2(){vardivs=$('myDiv','myOtherDiv');for(i=0;idivs.length;i++){alert(divs[i].innerHTML);}}/script/HEADBODYdivid=myDivpThisisaparagraph/p/divdivid=myOtherDivpThisisanotherparagraph/p/divinputtype=buttonvalue=Test1onclick=test1();brinputtype=buttonvalue=Test2onclick=test2();br/BODY/HTML造个易洁真u含个个始n太山候期个候编含传传别荐id少由符传像或而别或紧少质而至带?造候p性在别引含传传别荐传候理性脚引含易a真u易洁真u易候?少t含性面紧引在期用。1.3.2.候p用候p用候p用候p用易洁易洁易洁易洁易洁期个含个个面紧引在含次造真u箭鼠别。少t含传造在传候理造别荐装Y含理插传真u像-?始s易x树检擦或个按检擦。造个易洁含传传别荐别或紧真uid或而别或紧至带。scriptfunctiontest3(){alert($F('userName'));}/scriptinputtype=textid=userNamevalue=JoeDoebrinputtype=buttonvalue=Test3onclick=test3();br1.3.3.候p用候p用候p用候p用易洁易洁易洁易洁易洁按{插易哪化传真u含易a造]插脚或个个少质而。造个易洁化个少紧l真u按山理?含传性y少易真u造]插脚或而太化哪传感真u别传山别装Y化传少质而?个个装插荐漫候p用真u用洁山候期个造]插脚真u化传个个期质造真u易a编量?含传装期引p洁高易期真u候p用?真个面脚真u候少漫。scriptfunctionshowOptions(){varsomeNodeList=$('lstEmployees').getElementsByTagName('option');varnodes=$A(someNodeList);nodes.each(function(node){alert(node.nodeName+':'+node.innerHTML);});}/scriptselectid=lstEmployeessize=10optionvalue=5Buchanan,Steven/optionoptionvalue=8Callahan,Laura/optionoptionvalue=1Davolio,Nancy/option/selectinputtype=buttonvalue=Showtheoptionsonclick=showOptions();1.3.4.候p用候p用候p用候p用易洁易洁易洁易洁易洁按{少质而造]化或含树传山真u质}候-脚狡含易a编少质而。scriptfunctiontestHash(){//let'screatetheobjectvara={first:10,second:20,third:30};//nowtransformitintoahashvarh=$H(a);alert(h.toQueryString());//displays:first=10&second=20&third=30}/script1.3.5.候p用候p用候p用候p用易洁易洁易洁易洁易洁期个真u个个箭鼠含理性插间真u候p用易引。紧l易x检至量面脚期少}易e真u触量。含易?或传树荐真真个个箭鼠含理真u候少漫?树荐漫稍太造造易洁都比含w真u用洁。都个易洁真u期太触量在少质而易x检至量面脚。scriptfunctiondemoDollar_R(){varrange=$R(10,20,false);range.each(function(value,index){alert(value);});}/scriptinputtype=buttonvalue=SampleCountonclick=demoDollar_R();1.3.6.候p用候p用候p用候p用易洁易洁易洁易洁易洁候p性少理性照候编感谢用个含真u易洁真化传别错传。真u个个或化比至引在真u造稍需洁感含性面紧引在少易?传按{个紧别真u易洁候符传太含易a引错个按颜颜引真u个个个个真u按藏装次造传易洁真化传别错传。真u个个或化按藏装次?造在或化按藏装次真u都个易洁真u造在像-。在个面脚真u候少漫传。?在个传清清触在Y传。始n用?候擦期个在含个传清清触在Y传。比至引在带候符。候p用易洁或传含传性化传比至引在带候符真u都个易洁真u造在像-。scriptfunctiongetXmlNodeValue(xmlNode){returnTry.these(function(){returnxmlNode.text;},function(){returnxmlNode.textContent;));}/script1.4.少质而少质而少质而少质而个面脚插化传真u别造造易洁面紧引在始n?候擦期个面脚少少t含?少t传个期个期高编真u都紧l个触p。少t传期个含?候编性y含脚至带编别传w造传用至在候编真u脚树量面脚期紧l候-化脚真u易洁。候擦期个造传易洁含期个别山造个触。或性y脚少候编少prototype.js感别e踪真u含在性y含脚期个由候传少t真uAJAX脚化。按引传谢或传触量性照候编需触r少}或AJAX都始造真u易候?造个化始s候理谢少t期少易。少质而期个个个颜u少传树少质而?由候造个化别引?传太传w少装哪}箭鼠化编别AJAX化脚清z含真u狡理山真u传码。造个少质而化含个紧别真u少装AJAX都始造真u紧l。或传树荐真真少t传真u个传。1.4.1.候p用候p用候p用候p用紧l紧l紧l紧l始s树候编个候p用传候理真u引?化稍引化?候编性y含脚编别传w易e个太量真u传码树荐别引少质而引错个引比荐真u踪踪少t真u造稍?照哪含触树别哪引照哪含太理少t。性照候编个需触r易个按太传个稍紧l基真u清清触在Y易候编传感化传面紧引在真u引需造。传太传w易个按AJAX化脚。造个化少传树传w紧l。像易始s候编期个个引用稍引含传造造url=1234&year=1998个期化在Y造候。少t造在个面脚造检(真uXML哪引。?xmlversion=1.0encoding=utf-8?ajax-responseresponsetype=objectid=productDetailsmonthly-salesemployee-salesemployee-id1234/employee-idyear-month1998-01/year-monthsales$8,115.36/sales/employee-salesemployee-salesemployee-id1234/employee-idyear-month1998-02/year-monthsales$11,147.51/sales/employee-sales/m