This article mainly tells about the Ajax 20 interview questions, will have these questions, the interview is not afraid of, according to the above answer, certainly can find a good job. Now let's see this article together.
1, what is Ajax, why use Ajax (please talk about your understanding of Ajax)
What is Ajax:
Ajax is the abbreviation for "Asynchronous JavaScript and XML". He refers to a web development technique that creates interactive Web applications.
Ajax includes the following techniques:
Representation based on Web Standard (standards-basedpresentation) xhtml+css;
Use the DOM (Document ObjectModel) for dynamic display and interaction;
Using XML and XSLT for data exchange and related operations;
Using XMLHttpRequest to query and retrieve asynchronous data;
Use JavaScript to bind everything together.
2. Why use Ajax:
The advantages of AJAX applications are:
1. Improved user experience through asynchronous mode
2. Optimize the transfer between browser and server, reduce unnecessary data round-trip, reduce the bandwidth consumption
3. The Ajax engine runs on the client side, taking on part of the work that would otherwise have been done by the server, thereby reducing the load on the server under the large user volume.
2. What is the biggest feature of Ajax?
Ajax can be implemented dynamically without refreshing (partial refresh)
is to maintain the data without updating the entire page. This allows the Web application to respond more quickly to user actions and avoids sending information that has not changed on the network.
3, please describe the XMLHttpRequest object. The core of
Ajax is the JavaScript object XMLHttpRequest. This object was first introduced in Internet Explorer 5, which is a technique that supports asynchronous requests. In short, XMLHttpRequest allows you to use JavaScript to make requests to the server and handle the response without blocking the user. With the XMLHttpRequest object, Web developers can make a partial update of the page after the page is loaded.
4. What are the components of the AJAX technology system?
Html,css,dom,xml,xmlhttprequest,javascript
5, Ajax apps and traditional web apps are different.
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 reloads.
Because the server returns a new page each time, traditional Web applications can be slow and user interaction unfriendly. The
uses AJAX technology to enable JavaScript to interact directly with the server through XMLHttpRequest objects.
through HTTP request, a Web page can send a request to the Web server and accept the information returned by the Web server (without reloading the page), to show the user or a page, the user feels the page refresh, You also cannot see the send request and accept response to the JavaScript background.
6, Ajax requests a total of how many kinds of callback.
Ajax requests total eight kinds of callback
onsuccess
onfailure
onuninitialized
onloading
onLoaded
Oninteractive The difference between
OnComplete
Onexception
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, and it has nothing to do with Sun's Java language, and their similar names are just a marketing strategy.
In general Web development, JavaScript is performed on the browser side, and we can use JavaScript to control the browser's behavior and content.
How information is passed between the browser and the server in an AJAX application
Through XML data or string
8. How to get the server-side response XML data on the browser side.
The Responsexml property of the XMLHttpRequest object
9. XMLHttpRequest objects are created differently in IE and Firefox.
There, ie in the new ActiveXObject (), 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 HTTP requests can be supported by get,post or any server that you want to invoke.
The second parameter is the URL of the requested page.
Send () method, sending a specific request
Abort () method to stop the current request
The status of the ReadyState property request has 5 desirable values 0 = uninitialized, 1 = loading
2= to load, 3 = in interaction, 4 = complete
The response of the ResponseText property server, expressed as a string
The response of the Reponsexml property server, expressed as an XML
HTTP status code for Status server, 200 corresponds to OK 400 for not found
12. What is XML
XML is an Extensible markup language that can describe data with a series of simple tags
13, the parsing method of XML
Common use of Dom parsing and sax parsing. Dom parsing is a one-time read of an XML file and constructed as a DOM object for the program to use, the advantage is easy to operate, but less memory. Sax is parsed in an event-driven manner and consumes less memory, but programming is complex
14. What frame do you use (Rack bag)
This question is a must ask, generally also the beginning will ask.
More popular in Java are Dojo, Prototype, JQuery, DWR, ExtJS, etc.
15. If you are familiar with an AJAX framework, he may ask how to use the framework in the program
Dwr Framework Introduction
DWR (Directweb Remoting) is a Web remote call framework. Using this framework can make AJAX development simple. Using DWR, you can invoke the Java method on the server side directly from the client using JavaScript and return the value to JavaScript as if it were a direct local client call ( DWR dynamically generates Javascrip code based on the Java class.
DWR is implemented by reflection, translating Java into JavaScript, and then using a callback mechanism to implement JavaScript calling Java code
16, introduce the prototype
F () function, what is the function of $A () functions
The F () function is another welcome "shortcut key" that can be used to return the value of any form input control, such as the Textbox,drop-down list. This method can also be used as an argument with the element ID or the element itself.
The $A () function converts the individual parameters it receives into an array object.
17, introduce XMLHttpRequest object
With the XMLHttpRequest object, Web developers can make a partial update of the page after the page is loaded.
Ajax began to pop from Google's Suggest, which was used in 2005.
"Google Suggest" is to use the XMLHttpRequest object to create a dynamic Web interface:
When the user starts to enter Google's search box, JavaScript sends the characters entered by the user to the server, and 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 is a programming method that was launched and popular in 2005 by Google, and Ajax is not a new programming language, but it is a new programming technique that uses existing standards.
Using AJAX, you can create better, faster, and more user-friendly web applications. (Want to see more on the Topic.alibabacloud.comAJAX Development Manual section of the study)
Ajax technology is based on JavaScript and HTTP Request.
19. What are the main technologies that Ajax contains?
Definition of Ajax (asynchronous JavaScript + XML)
Representation based on the Web Standard (standards-based presentation) xhtml+css;
Use the DOM (Document Object Model) for dynamic display and interaction;
Using XML and XSLT for data exchange and related operations;
Using XMLHttpRequest to query and retrieve asynchronous data;
Use JavaScript to bind everything together. In English see the author of Ajax, the original text of Jesse James Garrett, the original topic (Ajax:a New approach to WEB applications).
Similar to DHTML or Lamp,ajax does not refer to a single technique, but rather organically utilizes a range of related technologies. In fact, some Ajax-based "derivation/composition" (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 that 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 capability.
3, can transfer the work of some previous server to the client, take advantage of the client idle ability to handle, reduce the burden of server and bandwidth, save space and broadband rental cost. and reduce the burden on the server, the principle of Ajax is "on-demand data", can minimize redundancy requests, and response 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 support of the search engine is weaker.
4. The abnormal mechanism of the program is destroyed.
5, not easy to debug.
This is the end of this article (want to see more on the Topic.alibabacloud.comAJAX User manual section of the study), there are questions can be in the message below the question.