Recently, an Ajax Real-Time Refresh Project was created. there is an application on the other side. when users use it, I can see that his name is still online. However, when reading data, we need to constantly refresh the page. I use js to refresh every few seconds, but it is slow to refresh once because the data volume on the server is large. I heard that Ajax can solve this problem. I learned about Ajax Real-time refresh.
I recently created a project with an application on the other side. Once the user is used, I can see that his name is still online. However, when reading data, we need to constantly refresh the page. I use js to refresh every few seconds, but it is slow to refresh once because the data volume on the server is large. I heard that Ajax can solve this problem. I learned for a while and read some instances, which are all triggered. I am so confused. I hope that Cheng Yuan, who has experience in this field, can give me a small example or something. Thank you first.
------ Solution --------------------
Long polling can solve this problem.
Find the comet tutorial on the network.
However, if your data volume is really large, it is estimated that optimization is necessary to solve the problem first.
------ Solution --------------------
Ajax is optimal for refreshing partial small data volumes, and big data must be optimized. LazyLoad
------ Solution --------------------
Comet, server Push
Www. ibm. com/ developerworks/ cn/ web/ wa-lo- w2fpak- comet/
------ Solution --------------------
The purpose of ajax is to use partial refresh to reduce loading of large data volumes,
This involves generating an interface for ajax data sending and receiving support for your own project, not simply modifying the js issue.
You have never touched ajax either.
We recommend that you open a page, such as ajax. php. familiarize yourself with/test ajax functions.
Write this function as a function and include it for calling.
------ Solution --------------------
If the data volume is large, there is no difference in the speed of partial ajax refresh and the overall page refresh.
If you have a small amount of data, you can use ajax to partially refresh the data without loading other resources on the page!
When a large amount of data is retrieved from the database, the loading time of other resources on the page is negligible!
Select one based on your situation! Large data volumes must be optimized!
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.