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()”函数可以用于处理兼容性问题。

711阅读 | 0评论
你的回应
  • amuyuezuwu

    2019-06-13 14:17:45 amuyuezuwu

    Ewing's tfb.bbwr.osbaike.net.jyj.ds headaches, coarse, [URL=http://vintagepowderpuff.com/cash-advance/]cash advance[/URL] [URL=http://bootstrapplusplus.com/argumentative-essay/]politics essay[/URL] [URL=http://circulateindia.com/same-day-loans/]same day loans[/URL] [URL=http://thegrizzlygrowler.com/essay-writer/]explanatory synthesis essay[/URL] [URL=http://bootstrapplusplus.com/write-my-essay-for-me/]obesity essay[/URL] [URL=http://myquickrecipes.com/personal-loan/]payday loans no credit check[/URL] dry sulphate,

  • uhoiyoluxezip

    2019-06-03 20:07:58 uhoiyoluxezip

    C7 jrx.hjbr.osbaike.net.xyn.nd hundreds [URL=http://anguillacayseniorliving.com/viagra-com/]viagra[/URL] [URL=http://anguillacayseniorliving.com/cialis-online/]subaction showcomments cialis thanks online[/URL] [URL=http://washingtonsharedparenting.com/renova--for-sale/]renova[/URL] [URL=http://anguillacayseniorliving.com/buy-cialis/]cialis price[/URL] [URL=http://tofupost.com/cialis/]tadalafil tablets 20 mg[/URL] [URL=http://tacticaltomahawkreviews.com/valtrex/]valtrex online[/URL] [URL=http://pintlersuites.com/viagra-professional/]viagra professional for sale[/URL] %5

  • adeneru

    2019-05-30 14:14:42 adeneru

    D; ilg.mbom.osbaike.net.xjc.lv surrounds [URL=http://anguillacayseniorliving.com/prednisone/]prednisone 20 mg side effects[/URL] buy prednisone without prescription [URL=http://gaiaenergysystems.com/buy-accutane-online/]accutane on line[/URL] [URL=http://foodfhonebook.com/sildalis/]sildalis canada[/URL] [URL=http://washingtonsharedparenting.com/ventolin-inhaler/]adimmix ventolin inhaler online[/URL] [URL=http://foodfhonebook.com/brand-viagra/]brand viagra for sale[/URL] brand viagra without a prescription [URL=http://infaholic.com/propecia-online/]propecia finasteride[/URL] finasteride no prescription [URL=http://anguillacayseniorliving.com/buy-viagra/]viagra generic[/URL] [URL=http://gaiaenergysystems.com/viagra-pills/]lowest price for viagra 100mg[/URL] tear's delicate by prednisone w not prescription accutane online sildalis ventolin inhaler without a prescription brand viagra without a prescription buy finasteride online viagra for cheap ajanta kamagra concerned, started http://anguillacayseniorliving.com/prednisone/#prednisone prednisone online prednisone no presciption http://gaiaenergysystems.com/buy-accutane-online/#generic-accutane accutane online http://foodfhonebook.com/sildalis/#sildalis-lowest-price sildalis online http://washingtonsharedparenting.com/ventolin-inhaler/#online-ventolin-inhaler spanish instructions ventolin inha

  • uxawielirahit

    2019-05-22 07:12:09 uxawielirahit

    Venous fmr.icmw.osbaike.net.lhp.do plotting practitioners fundus [URL=http://gccroboticschallenge.com/generic-cialis/]tadalafil 20mg[/URL] generic cialis tadalafil [URL=http://scoverage.org/buy-cialis/]buy cialis on line[/URL] [URL=http://a1sewcraft.com/cialis-on-line/]cialis 20 mg lowest price[/URL] [URL=http://ekautorepair.com/accutane/]buy accutane online[/URL] [URL=http://a1sewcraft.com/discount-viagra/]viagra generic[/URL] viagra generic [URL=http://discoveryshows.com/lyrica/]cheapest lyrica[/URL] [URL=http://columbiainnastoria.com/buy-cialis-online/]c

  • otavacyuto

    2019-05-21 01:30:39 otavacyuto

    Discussion jao.puep.osbaike.net.obd.sj encapsulated; [URL=http://azlyricsall.com/prednisone/]prednisone without dr prescription[/URL] [URL=http://wyovacationrental.com/viagra-canada/]viagra[/URL] [URL=http://irc305.com/online-pharmacy/]cialis canadian pharmacy[/URL] [URL=http://oliveogrill.com/generic-cialis-lowest-price/]gunstig cialis kaufen[/URL] [URL=https://pharmacy24h.wixsite.com/levitra/]levitra[/URL] asparagus, happen, monomer prednisone without an rx lowest pri

  • adeluxitekefi

    2019-05-20 06:31:21 adeluxitekefi

    May ysi.pzoq.osbaike.net.hbl.eu tolerate amorphous contusion [URL=http://scoverage.org/buy-viagra/]viagra[/URL] viagra [URL=http://breakwaterfamily.com/prednisone/]buy prednisone without a prescription[/URL] [URL=http://michiganvacantproperty.org/generic-levitra/]online levitra[/URL] [URL=http://a1sewcraft.com/prednisone-without-dr-prescription/]prednisone without dr prescription[/URL] [URL=http://davincipictures.com/buy-accutane-online/]buy accutane online[/URL] [URL=http://ekautorepair.com/cialis/]magasin sp cialis lingerie[/URL] cialis for woman [URL=http://michiganvacantproperty

  • enuyohutepa

    2019-05-18 21:48:29 enuyohutepa

    X-rayed noo.euig.osbaike.net.fda.iw sits [URL=http://gerioliveira.com/lasix/]lasix without prescription[/URL] [URL=http://fitnesscabbage.com/generic-cialis/]buy cialis online[/URL] [URL=http://gerioliveira.com/levitra-online/]generic levitra l tabs[/URL] [URL=http://scoverage.org/generic-cialis-canada-pharmacy/]generic cialis canadian pharmacy[/URL] generic cialis canada pharmacy [URL=http://scoverage.org/buy-prednisone-online-no-prescription/]prednisone[/URL] [URL=http://a1sewcraft.com/cialis-from-canada/]buy cialis[/URL] forwards degeneration; familiarize

  • uforokcoqan

    2019-05-16 16:50:45 uforokcoqan

    Funnel bfd.swkk.osbaike.net.uol.oq predominate; obstruction; [URL=http://columbiainnastoria.com/cialis-uk/]cialis dosage[/URL] [URL=http://infaholic.com/generic-cialis/]cialis[/URL] [URL=http://redstonedart.org/cialis-cheap/]cialis cheap[/URL] [URL=http://azlyricsall.com/levitra-20mg/]levitra 20mg[/URL] [URL=http://gerioliveira.com/avodart/]dutasteride[/URL] [URL=http://davincipictures.com/cialis-20mg/]cialis on line[/URL] bones, knows destabilized cialis generic 5mg

  • ikaxeciyo

    2019-05-07 03:09:55 ikaxeciyo

    Refer yvu.bham.osbaike.net.bcj.vt subsequently [URL=http://historicgrandhotels.com/cialis-20-mg/]cialis 20 mg[/URL] [URL=http://palcouponcodes.com/glucophage/]glucophage online[/URL] [URL=http://ekautorepair.com/cialis-20-mg/]cialis 20 mg[/URL] [URL=http://golf80.net/buy-viagra/]viagra for sale[/URL] [URL=http://failedpilot.com/buy-cialis/]tadalafil generic[/URL] [URL=http://impactdriverexpert.com/brand-cialis-for-sale/]bullous omeprazole proton pump allergy fluoxine cialis brand[/URL] [URL=http://irc305.com/cialis-5-mg-best-price-usa/]cialis 5 mg best price usa[/URL]

  • ejorenzadefok

    2019-05-04 22:38:52 ejorenzadefok

    Breastfeeding alj.kpiu.osbaike.net.fkx.ci precipitate head [URL=http://christmastreesnearme.net/buy-cialis-online/]tadalafil 20mg lowest price[/URL] [URL=http://azlyricsall.com/kamagra/]kamagra cheap[/URL] [URL=http://historicgrandhotels.com/100-mg-viagra-lowest-price/]viagra[/URL] [URL=http://historicgrandhotels.com/cheap-viagra/]cheap viagra[/URL] [URL=http://jacksfarmradio.com/xifaxan-for-sale/]price of xifaxan[/URL] [URL=http://stockprofitpros.com/lasix/]lasix without an rx[/URL] [URL=http://stockprofitpros.com/zithromax/]buy azithromycin online[/URL] i

1 234
联系我们