Ajax + PhP implement new dynamic refreshing Technology

Source: Internet
Author: User
Tags xslt

The SMS, online staff, and email check mechanisms of Tongda Oa are introduced. After analysis, I used Ajax technology. Ajax is a combination of multiple technologies. It is a dynamic technology that enables partial refreshing of web pages.

AjaxBasic principles

The web interaction effect implemented by Ajax is very different from the traditional one. Through the Ajax engine, the application process is natural and the operations are smooth, because it only exchanges useful data with the server, the page display and other unnecessary data are not reloaded. The Ajax engine is actually a comprehensive application of JavaScript, XML, XMLHttpRequest, and other technologies.

AjaxTechnical composition:

1. Standard rendering: XHTML and CSS

2. Dynamic Display and Interaction: Dom

3. Data exchange and processing: XML and XSLT

4. Adhesive: JavaScript,

AjaxAdvantages:

1. reduce the burden on the server, "retrieve data as needed ".

2. The page is refreshed.

3. Better user experience.

4. Make full use of the idle computing capability of the client.

5. Further promote the separation of presentation and data.

6. Fully implemented based on standardized technologies, with no need to download smallProgramOr plug-ins.

7. browser independence (ieownload, XML Island)

AjaxApplicable scenarios:

1. Form-driven Interaction

2. Deep tree navigation

3. fast communication and response between users

4. Irrelevant scenarios such as voting and yes/no

5. Data Filtering and data manipulation scenarios

6. common text input prompts and Automatic completion scenarios

AjaxUnsuitable scenarios:

1. Some simple forms

2. Search cannot be back (IFRAME is used)

3. basic navigation

4. Replace a large amount of text

5. Rendering operations

AjaxApplication Problems:

1. The javascript-based Ajax engine makes JavaScript compatibility and debugging a headache.

2. There is no need to refresh new loads of Ajax. Because the page changes are not as obvious as refreshing and reloading, it is easy to cause problems to users.

3. The intermediate process cannot be bookmark. (Two solutions)

Use WebStandard Development:

1. The current situation of the system hinders application self-adaptability and market expansion.

2. fully develop the web layer in a way that complies with web standards to support all popular browsers on the market and achieve high availability.

3. Standard technologies such as XHTML, CSS (Full layout), and Ajax are used. (Structure/presentation/completely separated behavior)

4. Use Firefox as the development environment, and the browser porting problem will be solved.

 

Ajax is called "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML). It is a Web page development technology used to create interactive web applications. It organically includes the following technologies:

Ajax (Asynchronous JavaScript + XML) Definition: representation based on the Web Standard (Standards-based presentation) XHTML + CSS; Dynamic Display and Interaction Using the DOM (Document Object Model; use XML and XSLT for data exchange and related operations; Use XMLHttpRequest for asynchronous data query and retrieval; use JavaScript to bind everything together.

Similar to DHTML or lamp, Ajax does not refer to a single technology, but organically utilizes a series of related technologies. In fact, some Ajax-based "derived/synthesized" (derivative/composite) technologies are emerging, such as "aflax ".

Ajax applications use Web browsers that support the above technologies as the operating platform. These browsers currently include Mozilla, Firefox, Internet Explorer, opera, Konqueror, and safari. However, opera does not support XSL format objects or XSLT.

AjaxCore Technology

The core of AJAX is JavaScript, XMLHttpRequest, and Dom. If the data format is XML, XML can be added. (The data returned by Ajax from the server can be XML, it can also be text or other formats ).

In the old interaction mode, the user triggers an HTTP request to the server. After the server processes the request, it returns a new hthl page to the client, each time the server processes a request submitted by the client, the client can only wait idle, and even if it is only a small interaction, it only needs to get a simple data from the server, you must return a complete HTML page, and each time you have to waste time and bandwidth to re-read the entire page. After Ajax is used, users feel that almost all operations will quickly respond to the waiting without page overloading (white screen.

1. XMLHttpRequest

One of the biggest features of AJAX is that data can be transmitted to or read/written to the server without refreshing the page. This feature is mainly due to the XMLHTTPRequest object of the XMLHTTP component. In this way, the desktop application can only exchange data with the server, without refreshing the interface every time or submitting data processing to the server, in this way, the server load is reduced, the response speed is accelerated, and the user waiting time is shortened.

Microsoft was the first to apply XMLHTTP. IE (ie5 or above) allowed developers to use the XMLHTTP ActiveX component to expand their functions on the web page, developers can directly transfer data to the server or retrieve data from the server without having to navigate the current web page. This function is very important because it helps reduce the pain of stateless connections. It can also eliminate the need to download redundant HTML, thus improving the process speed. Mozilla (mozilla1.0 or later and netscape7 or later) responds by creating its own inherited XML proxy class: XMLHttpRequest class. Konqueror (similar to Safari v1.2 and khtml-based browsers) also supports XMLHttpRequest objects, while opera will also support XMLHttpRequest objects in Versions later than v7.6x +. In most cases, the XMLHTTPRequest object is similar to the XMLHTTP component, and the methods and attributes are similar, but a small part of the attributes are not supported.

2. Javascript

Javascript is widely used in browsers.Programming Language, He used to be devalued as a bad language (he is really boring ), it is often used for show-off gadgets, pranks, or monotonous form verification. But the fact is that he is a real programming language, has its own standards and is widely supported in various browsers.

3. Dom

Document Object Model. Dom is a set of APIS for HTML and XML files. It provides the structure of the file, allowing you to change the content and visible objects. In essence, it is a bridge between web pages and scripts or programming languages. All the attributes, methods, and events that web developers can operate and create files are displayed as objects. For example, document represents the object, table objects represent HTML table objects ). These objects can be used as scripts by most browsers today. A webpage built with HTML or XHTML can also be seen as a group of structured data, which is blocked in the DOM (Document Object Model, dom supports reading and writing of objects in a webpage.

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.