解释AJAX如何改善网页的性能 [英] explain how AJAX can improve the performance of a web page

查看:76
本文介绍了解释AJAX如何改善网页的性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一直在努力解决这个问题,有人可以帮助吗

Been struggling on this question, could someone help please

推荐答案

这个问题几乎相当于告诉我什么是AJAX,因为AJAX旨在提高网页的性能,其中性能在很广泛的意义上被理解。



基于AJAX技术的优点和缺点这里解释: http://en.wikipedia.org/wiki/Ajax_%28programming%29 [ ^ ]。



AJAX是唯一完全基于纯HTTP的客户端方法,它允许客户端发送从整个网页或任何其他资源中抽象出来的一些HTTP请求。换句话说,您可以向服务器端发送请求,询问只有一个内联元素的内部文本的值。例如,您可以要求只有一个文本标签的值,具体取决于您在HTTP请求中发送的某些参数。要了解它的外观,请参阅上面引用的文章中的代码示例。



因此,由于更换内容,页面不会闪烁一整页相反,JavaScript在回调中接收新值(异步处理是重要的AJAX功能,因此页面在整个请求/响应行程期间保持响应)并为DOM对象分配新值。



-SA
This question is near-equivalent to "tell me what is AJAX", because the whole purpose of AJAX is to improve performance of a Web page, where "performance" is understood in a very wide sense of this word.

The benefits and drawbacks of AJAX-based technology are explained here: http://en.wikipedia.org/wiki/Ajax_%28programming%29[^].

AJAX is the only client-side method totally based on pure HTTP which allows the client-side to send some HTTP request abstracted from the whole Web page or any other resource. In other words, you can send a request to the server side asking for the value for inner text of only one inline element. For example, you can ask for a value of only one text label, depending on some parameters you send in an HTTP request. To understand how it looks, please see the code sample in the article referenced above.

As a result, the page does not "flicker" due to replacement of the content of a whole page. Instead, JavaScript receives a new value in a callback (asynchronous processing is the important AJAX feature, so the page remains responsive during the whole request/response trip) and assigns new value to the DOM object.

—SA


没有任何技术可以改善它自己的使用方式和位置有所作为,这取决于许多没有上下文无法回答的因素。
No technology can improve anything on it's own how and where you use it makes the difference, and that depends on many factors that can not be answered without context.


这篇关于解释AJAX如何改善网页的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆