Prototype.js Developer Handbook Complete __JS

Source: Internet
Author: User
Tags documentation ruby on rails
Prototype is an Open-source JavaScript development framework that encapsulates a number of ways to speed up development, such as using $ (' div ') instead of getElementById ("div"), encapsulating XMLHttpRequest, and so on. Many language development frameworks such as Ruby on Rails, Symfony (PHP) are integrated Prototype, there are many such as script.aculo.us, Rico, behaviour such derivative works, greatly expand the Protopype function, very Easy to implement automatically, element drag, flashing tips, rounded rectangle tip box, text fade, and other functions. Make the page "move" up, greatly improve the user experience. For the designer, the time spent on the UI has been greatly reduced, and the previous need for a long script code to achieve an effect may now take only one or two lines.
In Prototype, there are mainly two methods to implement asynchronous data transmission, respectively, Ajax.updater and Ajax.request.

[Copy to Clipboard] Code:function getcontents ()
{
var request_url = "test1.html"; The URL that needs to get the content
var request_pars = ';//Request Parameters
var myajax = new Ajax.updater (' result ', request_url,{//To bind Request_url return content to a container with ID result
Method: ' Get ',//http request, get or post
Parameters:request_pars,//Request parameters
Onfailure:reporterror,///When failure calls the ReportError function
Onloading:loading,//When the content is being obtained
Oncomplete:done//Content acquisition complete
Evalscripts:true
});
}
function loading ()
{
$ (' loading '). style.display = ' block ';
}
function done ()
{
$ (' loading '). Style.display = ' None ';
}
function ReportError (Request)
{
Alert (' Sorry. There is an error. ');
Ajax.updater provides us with three states for loading documents, oncomplete,onloading, OnFailure. We can customize a function corresponding to these three different states, so this feature, we can make a very cool like Gmail loading hint

prototype1.3.1 version of the developer manual. html

prototype1.4 version of the developer manual. html

Click to download this file 1.6

Click to download this file 1.5.1.1

Kjell Bublitz publishes Prototype chm API documentation and script.aculo.us reference documentation (including CHM, PDF format).

CHM: Click to download this file

Online API Documentation: HTTP://WWW.PROTOTYPEJS.ORG/API

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.