The basic concept of AJAX

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

1. What is AJAX, why to use AJAX (please talk about your understanding of AJAX)     what is Ajax:

  AJAX is “ Asynchronous  JavaScript  and  XML” ". He refers to a webpage development technology to create interactive webpage application.  

  Ajax contains the following:     based on the web standard (standards-based  presentation) XHTML+CSS representation,   

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

  Use   XML    XSLT  data exchange and related operations,

  Use   XMLHttpRequest  asynchronous data query, retrieval,  

  Use   JavaScript  binds everything together.

 Why use ajax:    in Ajax application advantages:  

   1. Through the asynchronous mode, and improve the user experience

   2. Optimizing the transmission between the browser and the server, reduce unnecessary data back and forth, reduce the bandwidth occupancy 

   3. The Ajax engine running on the client, do some work that was borne by the server, thereby reducing the large user amount of server load.  

 2. What is AJAX's biggest characteristic.  

Ajax can realize the dynamic not refresh (partial refresh)     is able to maintain data on condition of not updating the whole page. This makes Web applications more quickly respond to user actions, and avoid transmitting the information that has not changed in the Internet.  

 3. Please introduce the XMLHTTPREQUEST object?   

   The core of Ajax is the JavaScript object XmlHttpRequest. The object in the Internet  Explorer  first introduced in 5, it is a technical support asynchronous request. In short, XmlHttpRequest enables you to use the JavaScript request and process the response from the server, but does not block the user. Through the XMLHttpRequest object, Web developers can local update page in the page loading later.  

 4. What are the components of AJAX system?  

   HTML, css, dom, xml, xmlHttpRequest, javascript 

 5. Application of AJAX and traditional WEB application any different?   

In traditional Javascript programming, if you want to get the server database or file information, or the client sends information to the server, the need to build a HTML  form and GET or POST data to the server. Users need to click the ” Submit” button to send or receive data information, the server responds to the request and then wait, a page reload.

Because the server always returns a new page,   so the traditional web application may be   job wins by / resume   show your wonderful resume writing skills,... Before the interview is slow and user unfriendly...

The use of AJAX technology,   can make the Javascript through the XMLHttpRequest object directly interact with the server.

Through HTTP  Request,   an web page can send a request to the web server and the web server returns information (without reloading the page to show users), or on a page, the user feel refresh the page, also look not to send to the Javascript background to request and receive the response.  

  6. The total number of AJAX requests for CALLBACK  

Ajax request with a total of eight Callback  onSuccess  onFailure

onUninitialized  onLoading  onLoaded

onInteractive  onComplete  onException  

The difference between 7.AJAX and JAVASCRIPT?   

JavaScript is an executive in the browser scripting language, Ajax is a creation of interactive webpage development technology of   application; it is, by a series of related technology, including JavaScript.

Javascript is a scripting language developed by Netscape Co, and sun's Java language is no relationship, they are similar to name just a marketing strategy.

In the web development in general, JavaScript in the browser end execution, we can use JavaScript to control the browser behavior and content.

In   Ajax application is how to transfer information between the browser and the server

Through the XML data or string  

8, How to get XML data server response in the browser.  

The responseXMl property of the XMLHttpRequest object  

9,  The XMLHTTPREQUEST object is created in the IE and FIREFOX have different?

There, IE by NEW  ACTIVEXOBJECT (FIREFOX), the NEW    XMLHTTPREQUEST (obtained)  

10,  Commonly used methods and properties to introduce XMLHTTPREQUEST object (the more the better)

open(“method”,”URL”) A call to the server, the first parameter is the HTTP request

Methods for GET, supported by the POST or any server you want to call.  

The second parameter is the request page URL.  

send()Method, sending the request  

abort()Method, to stop the current request

The readyState property

State   request; 5 are   0= is not initialized  , 1= loading;

2= to load, 3= interaction, 4= 

responseText The attribute     server response, expressed as a string

reponseXML Properties of   the server's response, expressed as a XML

status

The server's HTTP status code, 200 corresponding ok    400 corresponding not found 

 11, The advantages and disadvantages of the AJAX

The biggest advantage of using Ajax, is able to maintain data on condition of not updating the whole page. This makes Web applications more quickly respond to user actions, and avoid transmitting the information that has not changed in the Internet.  

The application of Ajax is the main disadvantage of   normal behavior, it could undermine the browser Back button; because the XML technology used in Ajax, so in Ajax may also be asked to XML problem 

 12, What is XML

XML is extensible markup language, which can describe the data with a series of simple marker  

13, The analytical method of XML

Commonly used DOM analysis and sax analysis. DOM analysis is a one-time reads the XML file and its structure for the DOM object for use, has the advantages of convenient operation, but the more memory consumption. Sax is analytic in event driven mode, less memory, but the complexity of programming 

 14, You use is what frame (frame)?

The question will be asked, is generally the most began to ask.

More popular in Java   Dojo,   Prototype     , JQuery, Dwr,   extjs    etc.

  15, If you are familiar with some AJAX framework, he might ask how to use this framework in the program     DWR framework  n

DWR(Direct Web Remoting)WEB is a remote invocation framework. By using this framework allows AJAX  development becomes very simple. DWR can be used in the Java method using JavaScript direct calls to client server and returns a value to the JavaScript like native client call (DWR according to the Java class to dynamically generate JavaScrip code).    n  DWR the principle is reflected by the, The translation from Java to JavaScript, Then use the callback mechanism, Thus the   implementation of the JavaScript call Java code;

  16, Introduce PROTOTYPE $() function, $F () function, $A () function is what role?  

$() Method is to use the too frequent   in DOM; document.getElementById ( ); a convenient shorthand methods, like the DOM method, the elements of this method returns the parameter ID.  

$F()The function is another popular “ &rdquo shortcut keys, it can be used to return; any form the value of the input control, such as text  box, drop-down  list. This method can also be used ID element or elements themselves as parameter.

$A()A single function can take parameters it receives is converted into a Array object.  

 17,Introduce the XMLHTTPREQUEST object     through the XMLHttpRequest object, Web developers can local update page in the page loading later.

AJAX became popular in the use of Google in 2005”Google Suggest”.   

   “Google Suggest”The Web interface is to use a XMLHttpRequest object to create a dynamic:     when the user input Google search box, Javascript sends the characters input by the user to the server, and the server returns a list of suggestions.   The XMLHttpRequest object in IE5.0+,   Safari    1.2, Mozilla  1.0/Firefox,   Opera  8+  and NetScapt7  is beginning to support.

  18,Application of AJAX and traditional WEB application any different?  

 In traditional Javascript programming, if you want to get the server database or file information, or the client sends information to the server, the need to build a HTML  form and GET or POST data to the server. Users need to click the ” Submit” button to send or receive data information, the server responds to the request and then wait, a page reload.  Because the server always returns a new page,   so the traditional web application might be very slow and user unfriendly.   The use of AJAX technology,   can make the Javascript through the XMLHttpRequest object directly interact with the server.  Through HTTP  Request,   an web page can send a request to the web server and the web server returns information (without reloading the page to show users), or on a page, the user feel refresh the page, also look not to send to the Javascript background to request and receive the response.

  19,What is the full name of AJAX? Introduce AJAX  ?

  The full name of AJAX is Asynchronous  JavaScript  And  XML.    AJAX in 2005, sponsored by Google and programming method, the popularity of   AJAX is not a new programming language, but it is a known standard new programming technology.   The AJAX can be used to create a better, faster, more user friendly interface for Web application.  AJAX technology based on Javascript and HTTP Request.  

20, Commonly used methods and properties of the XMLHTTPREQUEST object is introduced.?

open(“method”,”URL”) A call on the server,

The first parameter is the HTTP request

Methods for GET, supported by the POST or any server you want to call.

The second parameter is the request page URL.   send () method, the specific request to send (  abort), stop the current request     readyState property

State   request; 5 are   0= is not initialized  , 1= loading   2= to load, 3= interaction, 4= 

   responseText Properties of   the server's response, expressed as a string of   reponseXML    properties; the server's response, expressed as a XML  status

The server's HTTP status code, 200 corresponding ok  400 corresponding not found 

 21, .AJAX mainly contains what techniques?

  Ajax(Asynchronous JavaScript + XML)The definition of     based on the web standard (standards-based  presentation) XHTML+CSS representation,  

  Use   DOM (Document  Object  Model) for dynamic display and interaction;     XML    XSLT  data exchange and related operations;     XMLHttpRequest  asynchronous data query, retrieval,

  Use   JavaScript  binds everything together. See English authors Ajax Jesse  James  Garrett of the original, the original title(Ajax: A New Approach to Web Applications).  

  Similar to DHTML or LAMP, AJAX does not refer to a single technology, but rather a series of organic use relevant technology. In fact, some of the AJAX based &ldquo / &rdquo synthesis; derivative; type (derivative/composite) technologies are emerging, such as“AFLAX”.

  The application of AJAX to support the above technique using web browser as a platform. These browsers currently include: Mozilla, Firefox, Internet  Explorer, Opera, Konqueror and Safari. But Opera does not support the XSL format object, also does not support the XSLT.  

 22,AJAX what are the advantages and disadvantages?   

  1,The big one is without refreshing the page, the user experience is very good.  

  2,The use of asynchronous communication with the server, has ability to respond more quickly.  

  3,Can put some server burden of work shifted to the client, to deal with the use of client idle, reducing bandwidth and server load, save space and bandwidth occupancy costs. And reduce the burden of the server, the principle of AJAX is “ on-demand access to data, ” can be reduced to the maximum extent redundancy request, and response to the server burden.  

   4,Based on the standardization of technical and widely supported, do not need to download the plug-in or small program.

 The disadvantages of Ajax 

 1,Ajax does not support back browser button.  

 2,The security problem of   AJAX exposes the interaction with the server details.

 3,On the search engine to support weak.  

  4,Destroy the exception mechanism program.

 5,Not easy to debug.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Cathy at November 13, 2013 - 10:20 PM