Prototype: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
* 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. | * 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. |
Revision as of 17:32, 1 November 2007
Useful Links
- Excellent Prototype examples and tutorials.
- Good check list of things to do and to avoid in Prototype.
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.