Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the required interview questions for AJAX?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you "what are the AJAX must-meet questions". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and study this article "what are the AJAX must-meet questions?"

1. What is AJAX and why use Ajax (please talk about your knowledge of Ajax)

What is ajax:

AJAX is the abbreviation of "Asynchronous JavaScript and XML". He is referring to a web development technology that creates interactive web applications.

Ajax includes the following technologies:

Representation of XHTML+CSS based on web Standard (standards-basedpresentation)

Use DOM (Document ObjectModel) for dynamic display and interaction

Use XML and XSLT for data exchange and related operations

Use XMLHttpRequest for asynchronous data query and retrieval

Use JavaScript to tie everything together.

2. Why use ajax:

The advantages of Ajax applications are:

1. Enhanced user experience through asynchronous mode

two。 Optimizes the transmission between the browser and the server, reduces unnecessary data round trips, and reduces bandwidth consumption

3. The Ajax engine runs on the client side and undertakes part of the work originally undertaken by the server, thus reducing the server load under a large number of users.

2. What is the most important feature of AJAX.

Ajax can achieve dynamic non-refresh (local refresh)

Is to be able to maintain data without updating the entire page. This allows Web applications to respond more quickly to user actions and avoids sending messages that have not changed over the network.

3. Please introduce XMLhttprequest object.

The core of Ajax is the JavaScript object XmlHttpRequest. This object, first introduced in Internet Explorer 5, is a technology that supports asynchronous requests. In short, XmlHttpRequest allows you to use JavaScript to make requests to the server and process responses without blocking users. Through the XMLHttpRequest object, Web developers can make partial updates to the page after the page is loaded.

4. What are the components of AJAX technology system?

HTML,css,dom,xml,xmlHttpRequest,javascript

5. What is the difference between AJAX application and traditional Web application.

In traditional Javascript programming, if you want to get the information on the server-side database or file, or send the client-side information to the server, you need to establish a 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 and reload the page.

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

Using AJAX technology, you can make Javascript interact directly with the server through the XMLHttpRequest object.

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). What is shown to the user is still a page, and the user feels that the page is refreshed, and can not see the sending request and receiving response made by the Javascript background.

6. How many kinds of CALLBACK are there in AJAX requests?

There are a total of eight Callback types for Ajax requests

OnSuccess

OnFailure

OnUninitialized

OnLoading

OnLoaded

OnInteractive

OnComplete

OnException

The difference between 7.Ajax and javascript.

Javascript is a scripting language executed in the browser. Ajax is a development technology for creating interactive web applications. It makes use of a series of related technologies, including javascript.

Javascript is a scripting language developed by Netscape. It has nothing to do with sun's java language. Their similar names are just a marketing strategy.

In general web development, javascript is executed on the browser side, and we can use javascript to control the behavior and content of the browser.

How to transfer information between browser and server in Ajax application

Through XML data or string

8. How to get the XML data of server response on the browser side.

The responseXMl property of the XMLHttpRequest object

9. Is there any difference in the way XMLHttpRequest objects are created in IE and Firefox.

Yes, it is obtained through new ActiveXObject () in IE and newXMLHttpRequest () in Firefox.

10. Introduce the common methods and properties of XMLHttpRequest objects.

Open ("method", "URL") establishes the call to the server. The first parameter is that the HTTP request method can be GET,POST or any server that you want to call.

The second parameter is the URL of the request page.

The send () method, which sends a specific request

Abort () method to stop the current request

The status of the readyState attribute request has 5 available values 0 = not initialized, 1 = loading

2 = to load, 3 = interactive, 4 = complete

The response of the responseText property server, represented as a string

The response of the reponseXML property server, expressed as XML

The HTTP status code of the status server. 200corresponds to ok 400corresponds 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 parsing method of XML

Commonly used dom parsing and sax parsing. Dom parsing is to read the xml file at one time and construct it as a DOM object for the program to use. It has the advantage of easy operation, but it consumes more memory. Sax is parsed in an event-driven manner and takes up less memory, but programming is complex.

14. What framework do you use (frame package)

This question is a must, and it is usually asked at the beginning.

The popular ones in java are dojo, Prototype, JQuery, Dwr, extjs and so on.

15. If he is familiar with some kind of ajax framework, he may ask how to use it in a program

Introduction to DWR Framework

DWR (DirectWeb Remoting) is a WEB remote invocation framework. Using this framework can make AJAX development very easy. With DWR, the Java method of the server can be called directly by JavaScript on the client side and the value can be returned to JavaScript as if it were directly called by the local client (DWR dynamically generates the JavaScrip code according to the Java class).

The implementation principle of DWR is to translate java into javascript through reflection, and then use callback mechanism to realize javascript calling Java code.

16. Introduce the functions of Prototype's $() function, $F () function and $A () function.

The $() method is a convenient abbreviation for the document.getElementById () method that is used too frequently in DOM, just like this DOM method, which returns the element of the id passed in by the parameter.

The $F () function is another popular "shortcut" that can be used to return the value of any form input control, such as textbox,drop-down list. This method can also take the element id or the element itself as a parameter.

The $A () function converts the individual parameters it receives into an Array object.

17. Introduce the XMLHttpRequest object

Through the XMLHttpRequest object, Web developers can make partial updates to the page after the page is loaded.

The popularity of AJAX began with the "Google Suggest" used by Google in 2005.

"Google Suggest" uses the XMLHttpRequest object to create a dynamic Web interface:

When the user starts entering 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.

What is the full name of AJAX? Can you introduce AJAX?

The full name of AJAX is Asynchronous JavaScript And XML.

AJAX is a popular programming method initiated by Google in 2005. AJAX is not a new programming language, but it is a new programming technology that uses existing standards.

Using AJAX, you can create better, faster, more user-friendly Web applications.

AJAX technology is based on Javascript and HTTP Request.

19. What are the main technologies of Ajax?

Definition of Ajax (Asynchronous JavaScript + XML)

Representation of XHTML+CSS based on web Standard (standards-based presentation)

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

Use XML and XSLT for data exchange and related operations

Use XMLHttpRequest for asynchronous data query and retrieval

Use JavaScript to tie everything together. In English, see the original text of Jesse James Garrett, the author of Ajax, the original title (Ajax: A New Approach to)

Web Applications).

Similar to DHTML or LAMP,AJAX does not refer to a single technology, but the organic use of a series of related technologies. In fact, some AJAX-based derivative/composite technologies are emerging, such as "AFLAX".

The application of AJAX uses a web browser that supports the above technologies as the running platform. These browsers currently include: Mozilla, Firefox, Internet Explorer, Opera, Konqueror and Safari. But Opera does not support XSL format objects, nor does it support XSLT.

What are the advantages and disadvantages of AJAX?

1, the biggest point is that the page is not refreshed, the user experience is very good.

2. Communicate with the server asynchronously, which has the ability to respond more quickly.

3. We can transfer the work of some previous servers to the client, make use of the idle ability of the client to deal with it, reduce the burden of the server and bandwidth, and save space and broadband rental costs. And reduce the burden on the server, ajax's principle is to "fetch data on demand", which can minimize the burden of redundant requests and responses on the server.

4. Based on standardized and widely supported technology, there is no need to download plug-ins or Mini Program.

Shortcomings of ajax

1. Ajax does not support browser back button.

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

3. The support for search engine is weak.

4. Destroy the exception mechanism of the program.

5. It is not easy to debug.

The above is all the contents of the article "what are the required interview questions for AJAX". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report