Your SlideShare is downloading. ×
Prototype 1.5.0
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Prototype 1.5.0

420
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
420
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Prototype JavaScript Library 1.5.0 Utility Methods String Enumerable Ajax (singleton) Element Form interpret(value) Handles enumeration XMLHttpRequest Interface Extends DOM nodes via $() and $$() (if Extends FORM nodes via $() and $$() (if $(s|el [,s|el,..]) executed as Singleton, element is executed as Singleton, element is Takes one or more element ID’s or gsub(pattern, f) each(f) getTransport() first argument) first argument) elements and mixes in Element methods sub(pattern, f, count n) eachSlice(n, f) activeRequestCount reset(frm) visible() $$(cssSelectors s[,s,s..]) scan(pattern, f) all(f) serializeElements(els) toggle() Returns array of elements using truncate(length, s) any(f) Ajax.Responders extends serialize() CSS Selectors hide() strip() collect(f) Enumerable (singleton) getElements() $A(a) show() stripTags() detect(f) Responds to Ajax events getInputs(type s, name s) Returns array with Array and remove() Enumerable methods stripScripts() findAll(f) responders disable() update(html s) $H(o) extractScripts() grep(pattern, f) register(o) enable() replace(html s) Returns array with Hash and evalScripts() include(o) unregister(o) findFirstElement() Enumerable methods inspect() escapeHTML() inGroupsOf(n, fillWith) dispatch(s, req, transport, json) focusFirstElement() recursivelyCollect(property s) $w(s) unescapeHTML() inject(memo, f) Splits string on spaces ancestors() focus() toQueryParams(separator) invoke(method s) select() Try.these(f[,f,f..]) Ajax.Request extends .Base descendants() toArray() max(f) serialize() Exits after first successful function Processes an Ajax request immediateDescendants() succ() min(f) getValue() initialize(url s, options o) previousSiblings() $F = Form.Element.getValue() camelize() partition(f) success() nextSiblings() clear() $R = new ObjectRange capitalize() pluck(property s) present() getHeader(s) match(selector) underscore() reject(f) activate() up(expression, index) Prototype dasherize() sortBy(f) disable() down(expression, index) inspect(dblquotes b) toArray() Ajax.Updater extends .Base enable() Version previous(expression, index) parseQuery = toQueryParams zip(a[,a,a..][,f]) and .Request BrowserFeatures.XPath next(expression, index) * reset and serializeElements can only be size() Updates a page element via Ajax called from Singleton ScriptFragment getElementsBySelector() Hash inspect() initialize(el, url s, options o) emptyFunction() getElementsByClassName(s) map=collect readAttribute(s) Form.Element = Field K() keys() find=detect Extends INPUT, TEXTAREA, and SELECT values() select=finaAll Ajax.PeriodicalUpdater getHeight() nodes via $() and $$() (if executed as Class merge(hash) extends .Base classNames() Singleton, element is first argument) Enables object to use intialize method member=include focus(el) toQueryString() Repeatedly updates element via Ajax hasClassName(s) as constructor entries=toArray select(el) create() inspect() initialize(el, url s, options o) addClassName(s) removeClassName(s) serialize() Selector Array extends Enumerable start() getValue() Object Extends default Array object stop() toggleClassName(s) clear() extend(dest o, src o) Selecting elements with CSS selectors observe() from(a) present() inspect(o) initialize(expression) Insertion.Before stopObserving() clear() activate() cleanWhitespace() keys(o) findElements(scope el) first() Insertion.Top empty() disable() values(o) toString() last() Insertion.Bottom childOf(ancestor el) enable() clone(o) matchElements(els, expression) compact() Insertion.After findElement(els,expression, index) extend Abstract.Insertion scrollTo() * focus and select can only be flatten() called from Singleton Function findChildElements(el, expressions) Handles content insertion getStyle(s) without(a) initialize(el, content s) setStyle(s) Abstract.EventObserver bind() indexOf(o) bindAsEventListener(o) Position reverse(inline b) getDimensions() initialize(el, f) DOM node positioning PeriodicalExecuter makePositioned() reduce() Number undoPositioned() includeScrollOffsets uniq() like setInterval but cooler makeClipping() Form.Element.EventObserver toColorPart() prepare() clone() initialize(f, freq n) undoClipping() Form.EventObserver succ() realOffset(el) size() stop() extends Abstract.EventObserver times(f) cumulativeOffset(el) inspect() getValue() positionedOffset(el) Event Abstract.TimedObserver toArray = clone Template offsetParent(element) Replaces default browser Event handling initialize(el, freq n, f) String template using #{var} markers within(el, x, y) Element.ClassNames element(evt) initialize(template s, pattern) winthinIncludingScrollOffsets extends Enumerable isLeftClick(evt) Form.Element.Observer Legend evaluate(o) (el, x, y) Handles element class names pointerX(evt) Form.Observer s=string b=boolean initialize(el) pointerY(evt) extends Abstract.TimedObserver overlap(’vertical’|’horizontal’, el) o=object [ ]=optional ObjectRange ext. Enumerable page(el) set(classname s) stop(evt) getValue() n=number | = or A numeric range clone(src el, target el) add(s) findElement(evt, tagname s) el=element pattern=regex initialize(start n, end n, exclusive b) absolutize(el) remove(s) observe(el, evtname, f, usecapture b) els=elements include(n) relativize(el) toString() stopObserving(el, evtname, f, usecapture b) f=function (callback)