Prototype

From Elvanör's Technical Wiki
Revision as of 17:32, 1 November 2007 by Elvanor (talk | contribs)
Jump to navigation Jump to search

Useful Links

Notes

  • Binding is one of the most useful functions in Prototype. In particular, when iterating over objects with an each and a defined function, the function won't be binded to the current object. You must manually bind it.
  • When using classes, use the Prototype classes functions (Class.create()).
  • evalJSON() works well, but not the same way as eval() as it is a String method, thus you call it directly on your JSON string.

Forms

  • If you have a DOM element of a form, don't use element.readAtrribute("value") to obtain its value as it will give you the initial value of the form. Use $F(element) directly.