Ajax interview Questions

Source: Internet
Author: User

What is Ajax?

Ajax is a web-page development technology to create interactive Web applications, the full name is asychronous JavaScript and XML, can be said to be a combination of existing technology, mainly for the client and server-side asynchronous communication effect, to achieve partial refresh of the page.

The advantages of AJAX applications are:

1. 通过异步模式,提升了用户体验2. 优化了浏览器和服务器之间的传输,减少不必要的数据往返,减少了带宽占用3. Ajax引擎在客户端运行,承担了一部分本来由服务器承担的工作,从而减少了大用户量下的服务器负载。
4、最大的一点是页面无刷新,用户的体验非常好。
5、使用异步方式与服务器通信,具有更加迅速的响应能力。6、可以把以前一些服务器负担的工作转嫁到客户端,利用客户端闲置的能力来处理,减轻服务器和带宽的负担,节约空间和宽带租用成本。并且减轻服务器的负担,ajax的原则是“按需取数据”,可以最大程度的减少冗余请求,和响应对服务器造成的负担。7、基于标准化的并被广泛支持的技术,不需要下载插件或者小程序。

ajax的缺点1、ajax不支持浏览器back按钮。2、安全问题 AJAX暴露了与服务器交互的细节。3、对搜索引擎的支持比较弱。4、破坏了程序的异常机制。5、不容易调试。
 

What is the biggest feature of Ajax?

Ajax可以实现动态不刷新(局部刷新)就是能在不更新整个页面的前提下维护数据。这使得Web应用程序更为迅捷地回应用户动作,并避免了在网络上发送那Information that has not changed.

Describe the process of Ajax.

1. Create an XMLHttpRequest object, that is, create an asynchronous call object

2. Create a new HTTP request and specify the method, URL, and authentication information for the HTTP request

3. Set functions that respond to changes in HTTP request status

4. Sending an HTTP request

5. Get the data returned by the asynchronous call

6. Using JavaScript and Dom for local refreshes

What is the difference between get and post and when to use post?

Get: Generally used for information acquisition, using URL to pass parameters, the number of messages sent is also limited, generally 2000 characters, some browsers are 8,000 characters

POST: Generally used to modify resources on the server, there is no limit to the information sent

Use the POST request in the following situations:

1. Unable to use cache file (update file or database on server)

2. Send a large amount of data to the server (POST has no data limit)

3. When sending user input with unknown characters, POST is more stable and more reliable than GET

What are Ajax and JSON, their pros and cons.

Ajax is the full name of asynchronous JavaScript Andxml, asynchronous JavaScript and XML, used to implement asynchronous data interaction in a Web page to achieve partial refresh of the page.

Advantages: Can make the page without overloading the entire content of the situation load local content, reduce the amount of data transmission, avoid users constantly refresh or jump page, improve the user experience

Disadvantage: Unfriendly to the search engine, the cost of the front-back function under Ajax is large, and the number of requests may increase the cross-domain problem limit;

JSON is a lightweight data interchange format, a subset of the ECMA

Pros: Lightweight, easy to read and write, easy to machine (JavaScript) parsing, support for composite data types (arrays, objects, strings, numbers)

The difference between the get and post methods when Ajax requests

Get is generally used for query operations, URL address has a length limit, the request parameters are exposed to the URL address, if you pass the Chinese parameters, you need to encode the operation, the security is low.

Post request is mainly used to submit data, there is no limit on the length of data, the content of the submitted data exists in the HTTP request body, the data will not be burst in the URL address.

Reference 72793475

Reference 78500837




 

Ajax interview Questions

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.