Develop AJAX applications like professionals, part 1th

Source: Internet
Author: User

Using Prototype JavaScript libraries and script.aculo.us

Today, WEB application development is almost equivalent to Ajax development. Ajax is no longer a supplement that is added to an application under special circumstances. It is now an integral part of WEB development. Using Ajax to enhance an application has been a challenging task for some people. Dealing with Cross-browser restrictions, writing a lot of complex JavaScript, and being familiar with digital coding are just a few of the challenges that Ajax developers face. Fortunately, there are already several open source JavaScript libraries that make these operations easier. In this 1th installment of the three-part series, you will use the Prototype JavaScript Library and script.aculo.us to create an Ajax application to manage songs.

This series of articles contains three sections, using two separate open source projects (Prototype JavaScript Libraries and script.aculo.us) to create excellent Ajax applications for Web 2.0 sites. In the 1th part of this series, let's start with the Prototype JavaScript library (see Resources for links). This article uses the current Prototype version of 1.6.0.2 (see Resources). Ajax involves dynamic data, so you need to use server-side technology. In this article, we use the PHP 5.2.1 with the Apache 2.0.59 and MySQL 5.0.41. (see Resources). Of course, you can also choose your own programming language, Web server, and database.

Prototype Introduction

If you are looking, you can find a lot of JavaScript libraries. There are two reasons: First, JavaScript is the browser language, so it is a key part of software development. Many people are writing JavaScript code, so there are a lot of JavaScript libraries out there. Second, JavaScript is complex, and the differences between browsers often make JavaScript development somewhat painful. Fortunately, JavaScript libraries often provide a variety of abstractions to mitigate this pain. Prototype is such a JavaScript library.

Prototype is a fairly broad library with many functions. Its functionality simplifies common tasks and focuses on Ajax. Prototype provides a cool way to inherit Java™ and C + + styles in JavaScript, extend HTML DOM elements, and utilities for JSON. In this article, you will focus on what Prototype can do for Ajax, while also learning about several Prototype other features.

Using the Ajax Library of Prototype

Prototype has many features designed to help you learn about Ajax development. One of the reasons why Prototype is so popular is that it doesn't limit how you do Ajax programming. For example, there are two common patterns that respond to xmlhttprequest (the underlying mechanism within AJAX): One way is to use the HTML that is used to redraw part of the screen, to respond with data, and to leave parsing data and redrawing for other JavaScript code processing. Prototype supports both of these modes. Let's see how it enables the first mode, that is, to respond with HTML.

Related Article

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.