- Prototype - Periodical Execution
- Prototype - Expressing Ranges
- Prototype - AJAX Support
- Prototype - JSON Support
- Prototype - Form Management
- Prototype - Event Handling
- Prototype - Enumerating
- Prototype - Templating
- Prototype - Basic Object
- Prototype - Hash processing
- Prototype - Array Processing
- Prototype - Strings Processing
- Prototype - Number Processing
- Prototype - Element Object
- Prototype - Utility Methods
- Prototype - Useful Features
- Prototype - Short Overview
- Prototype - Home
Prototype Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Prototype - Utipty Methods
The Prototype pbrary comes with lot of predefined objects and utipty functions. You can use those functions and objects directly in your JavaScript programming.
These methods are one of the cornerstones of efficient Prototype-based JavaScript coding. Spend some time to study them to become comfortable with the methods.
This chapter details all these useful methods with examples.
S.No. | Method & Description |
---|---|
1. | If provided with a string, returns the element in the document with matching ID; otherwise returns the passed element. |
2. | Takes an arbitrary number of CSS selectors (strings) and returns a document-order array of extended DOM elements that match any of them. |
3. | Converts the single argument it receives into an Array object. |
4. | Returns the value of a form control. This is a convenience apas of Form.Element.getValue. |
5. | Converts objects into enumerable Hash objects that resemble associative arrays. |
6. | Creates a new ObjectRange object. |
7. | Sppts a string into an Array, treating all whitespace as depmiters. |
8. | Accepts an arbitrary number of functions and returns the result of the first one that doesn t throw an error. |
document.getElementsByClassName
This method retrieves (and extends) all the elements that have a CSS class name of className.
However, this method has been deprecated in the latest versions of Prototype.
Advertisements