The Complete API Reference Sam Stephenson and the Prototype Team

The Complete API Reference Sam Stephenson and the Prototype Team

Prototype 1.5 The Complete API Reference Sam Stephenson and the Prototype Team Prototype 1.5: The Complete API Reference Sam Stephenson and the Prototype Team Published March 2007. 2nd edition. Copyright © 2006-2007 Sam Stephenson. Some rights reserved. 1 Prototype is a JavaScript framework that aims to ease development of dynamic web applications. Prototype was created by Sam Stephenson who re- leased the framework as an open-source project in February 2005. Other members of the core development team are: Thomas Fuchs, Justin Palmer, Andrew Dupont, Dan Webb, Scott Raymond, Seth Dillingham, Mislav Marohni#, Christophe Porteneuve and Tobie Langel. 2 This PDF book version of the Prototype API reference was created by Josh Clark , but all content comes from the Prototype site and is the intellec- tual property of Sam Stephenson and the Prototype core team. 3 This PDF is distributed under the Creative Commons Attribution-ShareAlike 2.5 . This means that you can copy, redistribute or create your own de- rivative works from this PDF, provided that you do so with the same Creative Commons license and include the foregoing notice. While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility for errors or omissions, or for dam- ages resulting from the use of the information contained herein. 1 http://www.prototypejs.org/ 2 http://www.globalmoxie.com/ 3 http://creativecommons.org/licenses/by-sa/2.5/ Table of Contents 1. Utility Methods ....................................................................................................................1 $ ....................................................................................................................................1 $$ ..................................................................................................................................3 $A .................................................................................................................................4 $F ..................................................................................................................................5 $H .................................................................................................................................5 $R ..................................................................................................................................6 $w ..................................................................................................................................6 Try.these ........................................................................................................................7 document.getElementsByClassName .................................................................................8 2. Ajax ....................................................................................................................................9 Ajax Options ..................................................................................................................9 Ajax.PeriodicalUpdater ................................................................................................... 12 Ajax.Request .................................................................................................................15 Ajax.Responders ............................................................................................................ 19 Ajax.Updater ................................................................................................................. 20 3. Array ................................................................................................................................23 Why you should stop using for…in to iterate (or never take it up) .................................... 23 What is a developer to do? .............................................................................................. 24 clear .............................................................................................................................25 clone ............................................................................................................................25 compact .......................................................................................................................25 each .............................................................................................................................26 first ..............................................................................................................................26 flatten ...........................................................................................................................26 from ............................................................................................................................26 indexOf ........................................................................................................................27 inspect ..........................................................................................................................27 last ...............................................................................................................................28 reduce ..........................................................................................................................28 reverse ..........................................................................................................................28 size ..............................................................................................................................29 toArray .........................................................................................................................29 uniq .............................................................................................................................29 without .........................................................................................................................30 4. Class .................................................................................................................................31 create ...........................................................................................................................31 5. Element ............................................................................................................................33 addClassName .............................................................................................................. 34 addMethods ..................................................................................................................34 ancestors ......................................................................................................................37 classNames ...................................................................................................................38 cleanWhitespace ............................................................................................................ 38 descendantOf ................................................................................................................ 39 descendants ..................................................................................................................40 down ............................................................................................................................40 empty ...........................................................................................................................42 extend ..........................................................................................................................42 getDimensions .............................................................................................................. 43 getElementsByClassName .............................................................................................. 43 getElementsBySelector ................................................................................................... 44 getHeight ......................................................................................................................45 getStyle .........................................................................................................................45 getWidth ......................................................................................................................46 hasClassName ............................................................................................................... 47 hide ..............................................................................................................................47 immediateDescendants ................................................................................................... 48 inspect ..........................................................................................................................49 makeClipping ................................................................................................................49 makePositioned ............................................................................................................. 50 match ...........................................................................................................................51 next .............................................................................................................................51

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    166 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us