Classic 20-Way Ajax face test (must be known) _ajax related

Source: Internet
Author: User
Tags html form http request object model xslt

1, what is Ajax, why to use Ajax (please talk about your knowledge of Ajax)

What is Ajax:

Ajax is the abbreviation for "Asynchronous JavaScript and XML". He refers to a web development technology that creates interactive Web applications.

Ajax includes the following technologies:

Representation based on Web Standard (standards-basedpresentation) xhtml+css;

Use DOM (Document ObjectModel) for dynamic display and interaction;

Use XML and XSLT for data exchange and related operations;

Using XMLHttpRequest to query and retrieve asynchronous data;

Use JavaScript to bind all things together.

2, why to use Ajax:

The advantage of AJAX applications is that:

1. Improved user experience through asynchronous mode

2. Optimizes the transmission between the browser and the server, reduces the unnecessary data round-trip, reduces the bandwidth occupation

3. The Ajax engine runs on the client, taking on a portion of the work that was originally undertaken by the server, thereby reducing the server load under large user capacity.

2, the most characteristic of Ajax is what.

AJAX enables dynamic non-refresh (local refresh)

is the ability to maintain data without updating the entire page. This allows Web applications to respond more quickly to user actions and avoid sending information that has not changed over the network.

3, please introduce the XMLHttpRequest object.

The core of Ajax is the JavaScript object XMLHttpRequest. This object was first introduced in Internet Explorer 5, which is a technology that supports asynchronous requests. In short, XMLHttpRequest allows you to use JavaScript to make requests to the server and process the response without blocking the user. With the XMLHttpRequest object, Web developers can make local updates to the page after the page is loaded.

4. What are the components of the AJAX technology system?

Html,css,dom,xml,xmlhttprequest,javascript

5. What is the difference between AJAX applications and traditional Web applications?

In traditional JavaScript programming, if you want information on a server-side database or file, or send client information to the server, you need to create an HTML form and then get or post data to the server side. Users need to click the "Submit" button to send or receive data information, and then wait for the server to respond to the request, the page reload.

Because the server returns a new page each time, traditional Web applications can be slow and user interaction unfriendly.

Using AJAX technology, you can enable JavaScript to interact directly with the server through XMLHttpRequest objects.

With HTTP request, a Web page can send a request to a Web server and accept the information returned by the Web server (without reloading the page), show the User A page, and the user feels the page refreshed, You also do not see send requests and accept responses to the JavaScript background.

6, the total number of Ajax requests callback.

Ajax requests total eight kinds of callback

Onsuccess
OnFailure
Onuninitialized
Onloading
OnLoaded
Oninteractive
OnComplete
Onexception

The difference between 7.Ajax and JavaScript.

JavaScript is a scripting language that executes on the browser side, and Ajax is a development technique for creating interactive Web applications that leverages a range of related technologies including JavaScript.

JavaScript is a scripting language developed by Netscape, which has nothing to do with Sun's Java language, and similar names are just a marketing strategy.

In general Web development, JavaScript executes on the browser side, and we can use JavaScript to control the behavior and content of the browser.

How information is passed between browsers and servers in AJAX applications

Through XML data or strings

8, how to get the server-side response in the browser XML data.

Responsexml property of XMLHttpRequest Object

9, the XMLHttpRequest object in IE and Firefox to create a different way.

There, ie in the new ActiveXObject () get, Firefox through the newxmlhttprequest () get

10, introduce the common methods and properties of XMLHttpRequest objects.

Open ("Method", "URL") establishes a call to the server, the first parameter is the way that HTTP requests can be supported by get,post or any server that you want to invoke.

The second parameter is the URL of the request page.

Send () method, sending a specific request

Abort () method to stop the current request

The state of the ReadyState property request has 5 desirable values 0 = uninitialized, 1 = loading
2= to load, 3 = interactive, 4 = complete

The response of the ResponseText property server, expressed as a string

Reponsexml the response of the property server, expressed as XML

Status server HTTP status code, 200 corresponding OK 400 corresponds to not found

12. What is XML

XML is an Extensible markup language that can describe data with a series of simple tags

13, the XML parsing way

Common use of Dom parsing and sax parsing. Dom parsing is a one-time read XML file and constructs it as a DOM object for program use, the advantage is easy to operate, but more memory-consuming. Sax is parsed in an event-driven way, with less memory, but with complex programming

14, you are using what frame (package)

This is a question that must be asked, and it is generally the first to ask.

More popular in Java are Dojo, Prototype, JQuery, DWR, ExtJS, etc.

15. If you are familiar with some kind of Ajax framework, he may ask how to use this framework in a program

Introduction to DWR Framework

DWR (Directweb Remoting) is a Web remote call framework. Leveraging this framework makes it easy to develop Ajax. Using DWR, you can use JavaScript directly to invoke the Java method on the server side and return the value to JavaScript as if it were a direct local client invocation ( DWR dynamically generates JAVASCRIP code according to Java classes.

The principle of DWR is to translate Java into JavaScript through reflection, and then use the callback mechanism to implement JavaScript invoke Java code

16, introduce the prototype $ () function, $F () function, $A () function is what the role

The $ () method is a handy shorthand for using the document.getElementById () method too frequently in the DOM, just like this Dom method, which returns the element of the ID that the parameter passed in.

The $F () function is another big welcome shortcut key that can be used to return the value of any form input control, such as Textbox,drop-down list. This method can also be used as an argument with the element ID or element itself.

The $A () function converts a single parameter that it receives to an array object.

17, introduce the XMLHttpRequest object

With the XMLHttpRequest object, Web developers can make local updates to the page after the page is loaded.

Ajax began to pop up with Google suggest, which Google used in 2005.

"Google suggest" is using the XMLHttpRequest object to create a dynamic Web interface:

When the user starts typing in Google's search box, JavaScript sends the user input characters to the server, and then the server returns a list of suggestions.

XMLHttpRequest objects are supported in ie5.0+, Safari 1.2, Mozilla1.0/firefox, Opera 8+ and NetScapt7.

18, what is the full name of Ajax? Introduce Ajax?

The full name of Ajax is asynchronous JavaScript and XML.

Ajax was a 2005-sponsored and popular programming method, Ajax is not a new programming language, but it is a new programming technology that uses existing standards.

Use Ajax to create better, faster, and more user-friendly web applications.

Ajax technology is based on JavaScript and HTTP Request.

19. What technologies does Ajax mainly contain?

The definition of Ajax (asynchronous JavaScript + XML)

A representation based on the Web Standard (standards-based presentation) xhtml+css;

Use DOM (Document Object Model) for dynamic display and interaction;

Use XML and XSLT for data exchange and related operations;

Using XMLHttpRequest to query and retrieve asynchronous data;
Use JavaScript to bind all things together. English See the author of Ajax, the original of Jesse James Garrett, the original topic (Ajax:a New approach to

Web applications).

Like DHTML or Lamp,ajax is not a single technology, but an organic use of a range of related technologies. In fact, some Ajax-based "derivation/Synthesis" (derivative/composite) technologies are emerging, such as "Aflax".

Ajax applications use a Web browser that supports the above technologies as a running platform. These browsers currently include: Mozilla, Firefox, Internet Explorer, Opera, Konqueror and Safari. However, Opera does not support XSL format objects, nor does it support XSLT.

20. What are the advantages and disadvantages of Ajax?

1, the biggest point is the page does not refresh, the user experience is very good.

2, the use of asynchronous way to communicate with the server, with more rapid response capabilities.

3, can put some of the previous server burden to the client, the use of idle client capacity to deal with, reduce the burden of server and bandwidth, save space and broadband rental costs. and reduce the burden on the server, the principle of Ajax is "on-demand data", can minimize redundant requests, and respond to the burden on the server.

4, based on standardized and widely supported technology, do not need to download plug-ins or small programs.

Disadvantages of Ajax

1, Ajax does not support the browser back button.

2. Security issues Ajax exposes the details of interacting with the server.

3, the search engine support is weaker.

4, the failure of the program's abnormal mechanism.

5, not easy to debug.

The above is a small set to introduce the classic 20 Ajax face test (must know), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.