Before writing this guide, let me first introduce what Prototype is mainly used for. If you pay more attention to ajax/javascript applications, you should have heard of this javascript framework. Prototype is a basic JavaScript application framework. Let me first quote an introduction from the official website
Prototype is a JavaScript framework that aims to ease development of dynamic web applications. Featuring a unique, easy-to-use toolkit for class- driven development and the nicest Ajax library around, Prototype is quickly becoming the codebase of choice for web application developers everywhere.
According to the author’s own introduction, the purpose of Prototype is to make it easier to develop javascript applications and use it It is more convenient and simple to use javascript programming to develop object-oriented javascript programs. Prototype contains a powerful and easy-to-use ajax framework. Prototype is a basic framework, and many higher-level frameworks are based on it. , for example, scriptaculous effect library Prototype contains the following parts:
base: The basic functions applied in Prototype, basically all other parts depend on it, including Class.create and Object for object-oriented style .extend, a Try object, function binding, number expansion, PeriodicalExecuter (the function of periodically executing a function), etc.
string: Extension of the String prototype, adding strip, escapeHTML and other useful methods to string
enumerable: The parent class object of enumerated types (array, hash, range, etc.), providing common methods of enumerated types
array: An extension of the Array prototype, adding indexOf, without and other methods to array
hash: provides a simple and easy-to-use Hash implementation for javascript
range: inherited from enumerable, a range (such as 3---67) object
ajax: a powerful and easy-to-use ajax framework
dom: Provides good cross-browser encapsulation for browser-based development, and adds many powerful functions
selector: Provides the function of selecting elements using class, css, etc.
form: Some functions about forms
event: Simple platform event encapsulation
position: provides some functions regarding element position
It can be said that Prototype is like a Swiss Army knife, encapsulating many common functions for javascipt. It greatly simplifies the development of JavaScript applications and adds a lot of confidence to JavaScript developers. Prototype can run on several platforms, and you no longer have to worry about various cross-platform issues when using it * Microsoft Internet Explorer for Windows, version 6.0 and higher * Mozilla Firefox 1.0/Mozilla 1.7 and higher * Apple Safari 1.2 and higher However, it should be noted that if you want to understand Prototype well, you should first understand some knowledge of javascript object-oriented development. Future articles will cover the specific aspects of Prototype. A detailed introduction to the methods in each function, including functions, examples, etc. Prototype official website: http://prototype.conio.net/. The current release version is only 1.4, but the current 1.5 has undergone great changes. Moreover, many prototype-based libraries use version 1.5, so it is strongly recommended to download the latest version of the code through svn.