Prototype.js cheat sheet

Document Sample
Prototype.js cheat sheet Powered By Docstoc
					Prototype.js cheat sheet                                                                                                                                                                                                                                                                                           1.6.0.2
                                                                                                                                                                                                                                                                                               designed by thinkweb2.com

Event                                                      Element (constructor)                                   Enumerable                         document                                            Prototype                                                       Utility Methods
element ( event )                                          absolutize ( element )                                  all ( iterator )                   fire ( eventName[, memo] )                          K ( argument )                                                  $ ( id | element )
extend ( event )                                           addClassName ( element, className )                     any ( iterator )                   observe ( eventName, handler )                      emptyFunction ( )                                               $$ ( cssRule )
findElement ( event, tagName )                             addMethods ( [methods] )                                collect ( iterator )               stopObserving ( eventName[, handler] )                                                                              $A ( iterable )
fire ( element, eventName[, memo] )                        adjacent ( element[, selectors... ] )                   detect ( iterator )                                                                    Prototype.Browser                                               $F ( element )
isLeftClick ( event )                                      ancestors ( element )                                   each ( iterator )                  document.viewport                                                                                                   $H ( [obj] )
                                                                                                                                                                                                          IE
observe ( element, eventName, handler )                    childElements ( element )                               eachSlice ( size, iterator )       getDimensions ( )                                   Opera                                                           $R ( start, end[, exclusive = false] )
pointerX ( event )                                         classNames                                              entries ( )                        getHeight ( )                                       WebKit                                                          $w ( String )
pointerY ( event )                                         cleanWhitespace ( element )                             find ( iterator )                  getScrollOffsets ( )                                Gecko                                                           Try.these ( Function... )
stop ( event )                                             clonePosition ( element, source[, options] )            findAll ( iterator )               getWidth ( )                                        MobileSafari                                                    document.getElementsByClassName
stopObserving ( element[, eventName[, handler]] )          cumulativeOffset ( element )                            grep ( regex, iterator )
                                                           cumulativeScrollOffset ( element )                      inGroupsOf ( size )                                                                    Prototype.BrowserFeatures
                                                                                                                                                      String (String.prototype)                                                                                           Class
Form                                                       descendantOf ( element, ancestor )                      include ( object )                                                                     XPath                                                           addMethods ( methods )
                                                                                                                                                      blank ( )
disable ( formElement )                                    descendants ( element )                                 inject ( accumulator, iterator )
                                                                                                                                                      camelize ( )                                                                                                        create ( [superclass][, methods... ])
enable ( formElement )                                     down ( element[, cssRule ][, index = 0] )               invoke ( methodName[, args ] )
                                                                                                                                                      capitalize ( )                                      RegExp
findFirstElement ( formElement )                           empty ( element )                                       map ( iterator )
                                                                                                                                                      dasherize ( )                                       escape ( string )
focusFirstElement ( formElement )                          extend ( element )                                      max ( iterator )                                                                                                                                       Position
                                                                                                                                                      empty ( )
getElements ( formElement )                                fire ( eventName[, memo ] )                             member ( object )                                                                                                                                      absolutize
                                                                                                                                                      endsWith ( substring )
getInputs ( formElement[, type[, name]] )                  firstDescendant ( element )                             min ( iterator )                                                                       RegExp (RegExp.prototype)                                       clone
                                                                                                                                                      escapeHTML ( )
                                                           getDimensions ( element )                               partition ( iterator )                                                                 match ( string )                                                cumulativeOffset
request ( [options] )                                                                                                                                 evalJSON ( [sanitize] )
                                                           getElementsByClassName                                  pluck ( propertyName )                                                                                                                                 offsetParent
reset ( formElement )                                                                                                                                 evalScripts ( )
                                                           getElementsBySelector                                                                                                                                                                                          overlap
serialize ( formElement[, getHash = false] )                                                                       reject ( iterator )                extractScripts ( )
                                                           getHeight ( element )                                                                                                                         PeriodicalExecuter (constructor)                                 page
serializeElements ( elements[, getHash = false] )                                                                  select ( iterator )                gsub ( pattern, replacement )
                                                           getOffsetParent ( element )                                                                                                                   stop ( event )                                                   positionedOffset
                                                                                                                   size ( )                           include ( substring )
                                                           getStyle ( element, property )                                                                                                                                                                                 prepare
Form.Element                                                                                                       sortBy ( iterator )                inspect ( [useDoubleQuotes] )                                                                                       realOffset
                                                           getWidth ( element )                                    toArray ( )                                                                           ObjectRange (constructor)
activate ( element )                                                                                                                                  interpolate ( object[, pattern] )                                                                                   relativize
                                                           hasClassName ( element, className )                     zip ( Sequence..., iterator )                                                         include ( value )
clear ( element )                                                                                                                                     isJSON ( )                                                                                                          within
                                                           hide ( element )
disable ( element )                                                                                                                                   parseQuery ( [separator = &] )                                                                                      withinIncludingScrolloffsets
                                                           identify ( element )
enable ( element )                                                                                                 Hash (constructor)                 scan ( pattern, iterator )                         Template (constructor)
focus ( element )                                          immediateDescendants
                                                                                                                   clone ( )                          startsWith ( substring )                           evaluate ( object )
getValue ( element )
                                                           insert ( element, {position: content} )                                                                                                                                                                        Insertion
                                                                                                                   each ( iterator )                  strip ( )
                                                           inspect ( element )                                                                                                                                                                                            After
present ( element )                                                                                                get ( key )                        stripScripts ( )
                                                           makeClipping ( element )                                                                                                                      TimedObserver                                                    Before
select ( element )                                                                                                 inspect ( )                        stripTags ( )
                                                           makePositioned ( element )                                                                                                                    new Form.Element.Observer ( element, freq, callback )            Bottom
serialize ( element )                                                                                              keys ( )                           sub ( pattern, replacement[, count = 1] )
                                                           match ( element, selector )                                                                                                                   new Form.Observer ( element, freq, callback )                    Top
setValue ( element, value )                                                                                        merge ( object )                   succ ( )
                                                           next ( element[, cssRule][, index = 0] )                                                   times ( count )
                                                                                                                   set ( key, value )
                                                           nextSiblings ( element )                                                                   toArray ( )
Ajax                                                                                                               toJSON ( )
                                                           observe ( element, eventName, handler )                                                    toJSON ( )
new Ajax.PeriodicalUpdater ( container, url[, options] )                                                           toObject ( )                                                                          Offsets/Dimensions
                                                           positionedOffset ( element )                                                               toQueryParams ( [separator = &] )
new Ajax.Request ( url[, options] )                                                                                toQueryString ( )
                                                           previous ( element[, cssRule][, index = 0] )                                               truncate ( [length = 30[, suffix = ‘...’]] )
new Ajax.Updater ( container, url[, options] )                                                                     unset ( key )
                                                           previousSiblings ( element )                                                               underscore ( )                                               var dOffsets = document.viewport.getScrollOffsets();
                                                                                                                   update ( object )
                                                           readAttribute ( element, attribute )                                                       unescapeHTML ( )
                                                                                                                   values ( )
Ajax.Responders                                            recursivelyCollect ( element, property )                                                   unfilterJSON ( [filter = Prototype.JSONFilter] )
register ( responder )                                     relativize ( element )
                                                                                                                   Object                                                                                                            dOffsets.top
unregister ( responder )                                   remove ( element )                                                                         Number (Number.prototype)
                                                                                                                   clone ( obj )
                                                           removeClassName ( element, className )                                                     abs ( )
                                                                                                                   extend ( dest, src )
Array (Array.prototype)                                    replace ( element[, html] )                                                                ceil ( )
                                                                                                                   inspect ( obj )
clear ( )                                                  scrollTo ( element )                                                                       floor ( )
                                                                                                                   isArray ( obj )                    round ( )                                                                   viewportOffset.top
clone ( )                                                  select ( element, selector... )
                                                                                                                   isElement ( obj )                  succ ( )                                                                                                cumulativeOffset.top
compact ( )                                                setOpacity ( element, opacity )
                                                                                                                   isFunction ( obj )                 times ( iterator )                                 dOffsets.left
each ( iterator )                                          setStyle ( element, styles )
                                                                                                                   isHash ( obj )                     toColorPart ( )
first ( )                                                  show ( element )
                                                                                                                   isNumber ( obj )                   toJSON ( )                                                                                                 fd
flatten ( )                                                siblings ( element )
from ( iterable )                                                                                                  isString ( obj )                   toPaddedString ( length[, radix] )
                                                           stopObserving ( element[, eventName[, handler]] )
                                                                                                                                                                                                                                                                                document.viewport.getHeight()
indexOf ( value )                                                                                                  isUndefined ( obj )                                                                                     viewportOffset.left
                                                           toggle ( element )
                                                                                                                   keys ( obj )
inspect ( )                                                toggleClassName ( element, className )                                                     Function (Function.prototype)
last ( )                                                                                                           toHTML ( obj )
                                                           undoClipping ( element )                                                                   argumentNames ( )
                                                                                                                                                                                                                                                    Element
reduce ( )                                                                                                         toJSON ( obj )                                                                                  cumulativeOffset.left
                                                           undoPositioned ( element )                                                                 bind ( thisObj[, arg...] )
reverse ( [inline = true] )                                                                                        toQueryString ( obj )
                                                           up ( element[, cssRule][, index = 0] )                                                     bindAsEventListener ( thisObj[, arg...] )
size ( )                                                                                                           values ( obj )
                                                           update ( element[, newContent] )                                                           curry ( arg... )
toArray ( )                                                viewportOffset ( element )                                                                 defer ( arg... )                                                                                           document.viewport.getWidth()
toJSON ( )
                                                           visible ( element )                                     Date (Date.prototype)              delay ( seconds[, arg...] )
uniq ( )                                                                                                           toJSON ( )
                                                           wrap ( element, wrapper[, attributes] )                                                    methodize ( )
without ( value... )
                                                           writeAttribute ( element, attribute[, value = true] )                                      wrap ( wrapperFunction[, arg...] )

				
DOCUMENT INFO
Description: Prototype.js cheat sheet