Prototype Javascript开发框架

Prototype是目前应用最为广泛的Ajax开发框架,其的特点是功能实用而且尺寸较小,非常适合在中小型的Web应用中使用。开发Ajax应用需要编写大量的客户端JavaScript脚本,而Prototype框架可以大大地简化JavaScript代码的编写工作。更难得的是,Prototype具备兼容各个浏览器的优秀特性,使用该框架可以不必考虑浏览器兼容性的问题。
Prototype对JavaScript的内置对象(如“String”对象、“Array”对象等)进行了很多有用的扩展,同时该框架中也新增了不少自定义的对象,包括对Ajax开发的支持等都是在自定义对象中实现的。Prototype可以帮助开发人员实现以下的目标:
(1)对字符串进行各种处理
(2)使用枚举的方式访问集合对象
(3)以更简单的方式进行常见的DOM操作
(4)使用CSS选择符定位页面元素
(5)发起Ajax方式的HTTP请求并对响应进行处理
(6)监听DOM事件并对事件进行处理
“Prototype”框架功能详解—使用实用函数,“Prototype”框架的实现仅仅包含一个JavaScript即可,1.6版本的“Prototype.js”的文件大小为127K字节,约4220行。在页面中应用的语法类似于:

然后就可以在后继的脚本中享受该框架带来的便利了。
该框架中有很多预定义的对象和实用函数,可以将程序员从重复的打字中解放出来。
(1)使用“$()”函数。
(2)使用“$F()”函数。此函数是另一个大收欢迎的“快捷键”,能用于返回任何表单输入控件的值,比如多行文本框和下拉列表框等控件。此个方法也能用元素id或元素本身做为参数。
(3)使用“$A()”函数。此函数能将其接收到的单个的参数转换成一个Array对象。
(4)使用“$H()”函数。此函数把一些对象转换成一个可枚举的和联合数组类似的Hash对象。
(5)使用“$R()”函数。此函数是“new ObjectRange(lowBound,upperBound,excludeBounds)”的缩写,用于建立一个范围对象。
(6)使用“Try.these()”函数。“Try.these()”方法用于调用不同的方法直到其中的一个成功。此函数把一系列的方法作为参数,并且按顺序的一个一个的执行这些方法,直到其中的一个成功执行。返回成功执行的那个方法的返回值。“Try.these()”函数可以用于处理兼容性问题。

647阅读 | 0评论
你的回应
  • ovasimiyau

    2019-04-15 13:44:22 ovasimiyau

    Those gwo.ejdf.osbaike.net.skw.pf cross-regeneration [URL=http://kafelnikov.net/ventolin/]ventolin online[/URL] [URL=http://sammycommunitytransport.org/imitrex/]order imitrex online rx pharmaceutical[/URL] [URL=http://albfoundation.org/careprost/]cheap careprost[/URL] [URL=http://americanartgalleryandgifts.com/prednisone/]prednisone[/URL] [URL=http://metropolitanbaptistchurch.org/vidalista/]vidalista[/URL] [URL=http://cbfsupply.com/cialis-5-mg-best-price-usa/]buying cialis online[/URL] [URL=http://nitromtb.org/revia/]discount revia[/URL] [URL=http://metropolitanbaptistch

  • asugawavud

    2019-04-14 16:02:08 asugawavud

    Remission kiz.qqyt.osbaike.net.obr.bc add appendicectomy, nephrocalcinosis; [URL=http://aakritiartsonline.com/cialis-20-mg/]generic cialis at walmart[/URL] [URL=http://gaiaenergysystems.com/levitra-20mg/]levitra 20mg[/URL] [URL=http://theswordguy.com/levitra/]generic levitra[/URL] [URL=http://stringerstheory.net/cialis/]order cialis online[/URL] [URL=http://gaiaenergysystems.com/buy-prednisone/]prednisone with no prescription[/URL] [URL=http://stringerstheory.net/amoxicillin/]buy amoxicillin[/URL] [URL=http://cbfsupply.com/pharmacy/]canadian pharmacy[/URL] canadi

  • uzocotomveki

    2019-04-08 10:55:50 uzocotomveki

    Here gfr.rkjb.osbaike.net.ksx.bw mine, [URL=http://bayridersgroup.com/prednisone/]prednisone without dr prescription[/URL] [URL=http://kafelnikov.net/prednisone-without-dr-prescription/]prednisone[/URL] [URL=http://gccroboticschallenge.com/doxycycline/]doxycycline[/URL] [URL=http://aawaaart.com/kamagra/]kamagra oral jelly canada[/URL] [URL=http://kafelnikov.net/accutane/]accutane[/URL] [URL=http://gccroboticschallenge.com/buy-kamagra-online/]buy cheap kamagra from india[/URL] pre-renal liposomes wheelchair buy prednisone withou

  • etumivamoq

    2019-03-18 12:54:41 etumivamoq

    Heavy mli.mhmp.osbaike.net.stk.vl blows set [URL=http://websolutionsdone.com/propecia/]propecia[/URL] online propecia http://websolutionsdone.com/propecia/#buy-propecia-online buy propecia online propecia [URL=http://websolutionsdone.com/viagra/]viagra for sale[/URL] viagra uk http://websolutionsdone.com/viagra/#viagra-online viagra [URL=http://openastorenow.com/personal-loan/]personal loans austin tx[/URL] personal loan interest rates in usa http://openastorenow.com/personal-loan/#personal-loan personal loan [URL=http://refrigeratordealers.com/amoxicillin/]500 mg amoxicillin[/URL] amoxil http://refrigeratordealers.com/amoxicillin/#www.amoxicillin500mg.org amoxicillin online [URL=http://refrigeratordealers.com/prednisone/]prednisone[/URL] buy prednisone online http://refrigeratordealers.com/prednisone/#buy-prednisone-online prednisone order [URL=http://anger-management-action.com/payday-loans-irving-tx/]direct online lenders[/URL] payday loans http://anger-management-action.com/payday-loans-irving-tx/#loan-to-pay-off-payday-loans payday loans [URL=http://umichicago.com/short-cash-loans/]cash loans columbus ohio[/URL] cash loans http://umichicago.com/short-cash-loans/#short-cash-loans short cash loans [URL=http://palawan-resorts.com/canadian-pharmacy-online/]canada pharmacy online no script[/URL] pharmacy http:

  • aqimedigiton

    2019-02-25 16:25:39 aqimedigiton

    She zyi.gwmw.osbaike.net.ham.nf stomach; [URL=http://davincipictures.com/retin-a/]buy retin a online[/URL] tretinoin cream 0.1 http://davincipictures.com/retin-a/#where-to-buy-tretinoin-gel retin a cream [URL=http://davincipictures.com/prednisone/]buy prednisone[/URL] buy prednisone without prescription http://davincipictures.com/prednisone/#buy-prednisone prednisone without dr prescription usa [URL=http://davincipictures.com/doxycycline/]doxycycline[/URL]

  • eqotvazexk

    2019-02-19 22:22:25 eqotvazexk

    The wor.jgbv.osbaike.net.myi.os describe pulsatile; dehydrated [URL=http://michiganvacantproperty.org/buy-propecia/]propecia pills[/URL] online propecia http://michiganvacantproperty.org/buy-propecia/#propecia-online-pharmacy propecia pills [URL=http://scoverage.org/celebrex-200-mg/]celebrex[/URL] celebrex 200 mg http://scoverage.org/celebrex-200-mg/#celebrex celebrex generic [URL=http://biblebaptistny.org/nolvadex/]nolvadex in uk[/URL]

  • sedpakewenoba

    2019-02-14 09:42:42 sedpakewenoba

    Later, cle.ycpb.osbaike.net.tfa.hu pre-operatively plus training [URL=http://secretsofthearchmages.net/ventolin/]ventolin[/URL] buy ventolin http://secretsofthearchmages.net/ventolin/ ventolin [URL=http://otrmatters.com/levitra-20mg/]wife levitra[/URL] levitra 20mg http://otrmatters.com/levitra-20mg/ pharmacy prices for levitra [URL=http://kelipaan.com/flagyl/]metronidazole 500 mg antibiotic[/URL] flagyl http://kelipaan.com/flagyl/ buy metronidazole online [URL=http://gocyclingcolombia.com/generic-levitra-vardenafil-20mg/]levitra 20mg[/URL] generic levitra vardenafil 20mg http://gocyclingcolombia.com/generic-levitra-vardenafil-20mg/ levitraonline [URL=http://playinguphockey.com/generic-levitra/]levitra 20 mg[/URL] generic levitra http://playinguphockey.com/generic-levitra/ levitra 20mg vardenafil 20mg [URL=http://webodtechnologies.com/cialis-online/]cialis online[/URL] tadalafil 20mg lowest price http://webodtechnologies.com/cialis-online/ cialis [URL=http://gocyclingcolombia.com/levitra-20-mg/]levitra[/URL] levitra http://gocyclingcolombia.com/levitra-20-mg/ levitra 20 mg [URL=http://webodtechnologies.com/generic-levitra-20mg/]best price levitra 20 mg[/URL] levitra http://webodtechnologies.com/generic-levitra-20mg/ best price levitra 20 mg [URL=http://a1sewcraft.com/walmart-

  • opapijaxigut

    2019-02-13 16:19:45 opapijaxigut

    Background div.dpvo.osbaike.net.hul.ok compensates goes [URL=http://iranascience.com/viagra-generic/]viagra generic[/URL] generic viagra 50mg http://iranascience.com/viagra-generic/ buy viagra online [URL=http://playinguphockey.com/zoloft/]zoloft no prescription[/URL] zoloft no prescription http://playinguphockey.com/zoloft/ zoloft medicine [URL=http://cveto4ki.com/inderal/]inderal[/URL] buy inderal online http://cveto

  • ecebuce

    2019-02-10 18:17:58 ecebuce

    The jmd.skpb.osbaike.net.kob.nm shown aspergillosis [URL=http://gocyclingcolombia.com/cipro/]cipro[/URL] cipro http://gocyclingcolombia.com/cipro/ buy ciprofloxacin 500 mg [URL=http://healinghorsessanctuary.com/levitra/]generic levitra online[/URL] levitra generic 20 mg http://healinghorsessanctuary.com/levitra/ levitra generic lowest prices [URL=http://webodtechnologies.com/retin-a-cream/]retin a cream[/URL] renova cheap http://webodtechnologies.com/retin-a-cream/ retin a online [URL=http://webodtechnologies.com/buy-viagra/]viagra canada[/URL] viagra online canada http://webodtechnologies.com/buy-viagra/ low price viagra 100mg [URL=http://fitnesscabbage.com/generica-cialis/]cialis black[/URL] generica cialis http://fitnesscabbage.com/generica-cialis/ generica cialis [URL=http://dockpartsusa.com/zoloft-online/]buy zoloft[/URL] buy sertraline http://dockpartsusa.com/zoloft-online/ zoloft [URL=http://techiehubs.com/viagra-generic/]buy generic viagra[/URL] viagra generic http://techiehubs.com/viagra-generic/ viagra [URL=http://a1sewcraft.com/furosemide-without-prescription/]diuretic and lasix[/URL] lasix overdose http://a1sewcraft.com/furosemide-without-prescription/ furosemide cat [URL=http://nothingbuthoops.net/viagra/]viagra[/URL]

  • igiwlupu

    2019-02-10 16:22:25 igiwlupu

    Venous, hoa.ystq.osbaike.net.zgm.tt screened poisonous salpingo-oophorectomy [URL=http://desktopindia.com/pharmacy/]pharmacy[/URL] cialis canadian pharmacy http://desktopindia.com/pharmacy/ cialis from canadian pharmacy [URL=http://gocyclingcolombia.com/levitra-20-mg/]levitra[/URL] levitra 20 mg http://gocyclingcolombia.com/levitra-20-mg/ www.levitra [URL=http://ahecanada.com/levitra/]levitra online[/URL] levitra http://ahecanada

1 23
联系我们